Gorilla 压缩归档与 MoonPromQL 查询数据源适配
Dependencies
///|
test "closed range query filters decoded points" {
let b = @gorilla.encode([
{ timestamp: 1L, bits: 0UL, },
{ timestamp: 2L, bits: 1UL, },
{ timestamp: 3L, bits: 2UL, },
])
assert_eq(@gorilla.decode_range(b, 2L, 2L), [{ timestamp: 2L, bits: 1UL, }])
assert_eq(@gorilla.decode_range(b, 4L, 5L), [])
assert_true(
try {
ignore(@gorilla.decode_range(b, 5L, 4L))
false
} catch {
_ => true
},
)
}pub struct ArchiveDecoder {
// private fields
}pub struct ArchiveEncoder {
// private fields
}pub struct ArchiveIndex {
// private fields
}fn ArchiveIndex::decode_block(self : ArchiveIndex, index : Int, frame : Bytes) -> Array[Sample] raise CodecErrorfn ArchiveIndex::select(self : ArchiveIndex, start : Int64, end : Int64) -> Array[Int] raise CodecErrorpub struct Decoder {
// private fields
}pub struct Encoder {
// private fields
}pub struct XorDecoder {
// private fields
}pub struct XorEncoder {
// private fields
}fn crc32(bytes : Bytes) -> UInt