JASERIES (JAnalyseSeries) 1.2.0 released
JASERIES is a scala API for time numeric series operations. ( ** project page **)
Latest changes :- now using sbt 0.12
- now using sbteclipse 2.1.0
- now using sbt-assembly 0.8.3
- now using scalatest 1.8
- Series factories enhancements
- showLegend boolean added to chartConfig.
- Add support for QuoteCell (for stock series processing)
- Various Code cleanup and enhancements.
- Add date automatic support for google finance historical data (although the API will be shutdown ~ october 2012)
- CSV2Series now supports direct parsing of Quote Series ( CSV2Series.quoteFromURL )
- Automatic supports of CSV with all cells in quotes
- new tests cases (quotes)
- duration based takeRight and dropRight method added
- chart classes refactoring
- stacked chart type added : StackedChart class (BUT still work in progress as TableXYDataSet implies the same number of cells in each series !!!)
- Series sample method now preserves cell type !! (was previously returning a StatCell!!)
- statSample method added to Series to allow sampling using StatCell
- toSeries method added to Series to allow cell type conversions
- Series count2Rate method renamed to toRate
Apache total accesses counter to hit rate
The following example demonstrates how to convert a global http hit counter, into a hitrate series:
import fr.janalyse.series._
val csv = CSV2Series.fromURL("http://dnld.crosson.org/modstatus-totalaccesses.csv")
val totalaccesses=csv.values.head
val hitrate=
totalaccesses
.delta
.toSeries[AddCell]
.sample("10m")
.toRate()
.rename("http hit rate")
CSV2Series.toFile(hitrate, "hitrate.csv")
JVM processing time to JVM cpu usage
The following example demonstrates how to convert a java process cpu time counter (mbean : java.lang:type=OperatingSystem__ProcessCpuTime), into a cpu usage metric (here I didn't take into account the number of CPU, so max value = cpu count * 100):
import fr.janalyse.series._
val csv = CSV2Series.fromURL("http://dnld.crosson.org/processcputime.csv")
val cputime=csv.values.head
val cpucells =
for(Seq(a,b) <- (cputime / 1000d / 1000d).sliding(2).toIterable )
yield a.time->(b.value-a.value)/(b.time-a.time)*100d
val cpuusage = Series[StatCell]("cpu usage percent", "5m") <<< cpucells
CSV2Series.toFile(cpuusage, "cpuusage.csv")