Interoperate with HdrHistogram interval logs and compare merged latency distributions.
moon update
moon build --target native --release
hlog=_build/native/release/build/cmd/hlog/hlog.exe
"$hlog" summary tests/fixtures/baseline.hlog --tag read --json
"$hlog" compare tests/fixtures/baseline.hlog tests/fixtures/candidate.hlog \
--tag read --from 1 --until 2 --max-p99-increase-pct 5
"$hlog" report tests/fixtures/baseline.hlog tests/fixtures/candidate.hlog \
--window 1 --max-p99-increase-pct 5 --json
"$hlog" rewrite tests/fixtures/candidate.hlog /tmp/moonhlog-candidate.hlog"$hlog" report tests/fixtures/baseline.hlog tests/fixtures/candidate.hlog \
--window 1 --tag write --min-samples 100 --max-p99-increase-pct 5 --json"$hlog" report tests/fixtures/baseline.hlog tests/fixtures/candidate.hlog \
--window 1 --from 1 --until 2 --baseline-unit ns --candidate-unit ns \
--selected-only --max-p99-increase-pct 5 --jsonmoon package
scripts/verify-consumer.sh _build/publish/guo-dong-123-moon-hlog-0.3.0.zipfn read_p99(text : StringView) -> Int64? raise @hlog.HlogError {
let log = @hlog.parse_log(text)
let selection : @hlog.Selection = {
tag: Some("read"),
from: Some(0.0),
until: Some(2.0),
}
match log.aggregate(selection) {
Some(histogram) => histogram.percentile(9900)
None => None
}
}moon check --target all --deny-warn
moon test --target all --deny-warn
moon fmt --check
moon build --target native --release --deny-warn
scripts/verify-interop.sh _build/native/release/build/cmd/hlog/hlog.exepub(all) suberror HlogError {
Invalid(String)
Unsupported(String)
Incompatible(String)
} derive(Debug)pub struct Histogram {
// private fields
}pub struct Interval {
tag : String?
relative_start : Double
absolute_start : Double
duration : Double
histogram : Histogram
// private fields
}pub struct Log {
start_time : Double
base_time : Double
// private fields
}pub struct LogParser {
// private fields
}pub struct WindowAccumulator {
// private fields
}fn WindowAccumulator::WindowAccumulator(selection : Selection, seconds : Double) -> WindowAccumulator raise HlogErrorfn WindowAccumulator::compare(self : WindowAccumulator, other : WindowAccumulator) -> Array[WindowComparison] raise HlogErrorInstall
Download zipInteroperate with HdrHistogram interval logs and compare merged latency distributions.