Compare commits
2 Commits
14f1531276
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c97003bc4f | |||
| 37893fc805 |
@@ -712,6 +712,7 @@ func (s *Database) ListInstantPeriods(conn net.Conn, req proto.ListInstantPeriod
|
|||||||
responseWriter, err := transform.NewInstantPeriodsWriter(transform.InstantPeriodsWriterOptions{
|
responseWriter, err := transform.NewInstantPeriodsWriter(transform.InstantPeriodsWriterOptions{
|
||||||
Dst: conn,
|
Dst: conn,
|
||||||
GroupBy: req.GroupBy,
|
GroupBy: req.GroupBy,
|
||||||
|
Since: uint32(since.Unix()),
|
||||||
AggregateFuncs: req.AggregateFuncs,
|
AggregateFuncs: req.AggregateFuncs,
|
||||||
FirstHourOfDay: req.FirstHourOfDay,
|
FirstHourOfDay: req.FirstHourOfDay,
|
||||||
})
|
})
|
||||||
|
|||||||
BIN
database_linux
BIN
database_linux
Binary file not shown.
BIN
database_windows
BIN
database_windows
Binary file not shown.
@@ -246,8 +246,6 @@ GetMetric:
|
|||||||
|
|
||||||
cumulativeMeasures := GenerateCumulativeMeasures(seriesInDays)
|
cumulativeMeasures := GenerateCumulativeMeasures(seriesInDays)
|
||||||
|
|
||||||
//pretty.PPrintln("CUMULATIVE MEASURES", cumulativeMeasures)
|
|
||||||
|
|
||||||
err = conn.AppendMeasures(proto.AppendMeasuresReq{
|
err = conn.AppendMeasures(proto.AppendMeasuresReq{
|
||||||
MetricID: cumulativeMetricID,
|
MetricID: cumulativeMetricID,
|
||||||
Measures: cumulativeMeasures,
|
Measures: cumulativeMeasures,
|
||||||
|
|||||||
BIN
loadtest_linux
BIN
loadtest_linux
Binary file not shown.
BIN
loadtest_windows
BIN
loadtest_windows
Binary file not shown.
BIN
requests_linux
BIN
requests_linux
Binary file not shown.
BIN
requests_windows
BIN
requests_windows
Binary file not shown.
@@ -16,6 +16,7 @@ import (
|
|||||||
type InstantPeriodsWriterOptions struct {
|
type InstantPeriodsWriterOptions struct {
|
||||||
Dst io.Writer
|
Dst io.Writer
|
||||||
GroupBy diploma.GroupBy
|
GroupBy diploma.GroupBy
|
||||||
|
Since uint32
|
||||||
AggregateFuncs byte
|
AggregateFuncs byte
|
||||||
FirstHourOfDay int
|
FirstHourOfDay int
|
||||||
}
|
}
|
||||||
@@ -25,6 +26,7 @@ type InstantPeriodsWriter struct {
|
|||||||
arr []byte
|
arr []byte
|
||||||
responder *ChunkedResponder
|
responder *ChunkedResponder
|
||||||
groupBy diploma.GroupBy
|
groupBy diploma.GroupBy
|
||||||
|
since uint32
|
||||||
firstHourOfDay int
|
firstHourOfDay int
|
||||||
time2period func(uint32) time.Time
|
time2period func(uint32) time.Time
|
||||||
currentPeriod time.Time
|
currentPeriod time.Time
|
||||||
@@ -63,6 +65,7 @@ func NewInstantPeriodsWriter(opt InstantPeriodsWriterOptions) (*InstantPeriodsWr
|
|||||||
arr: make([]byte, 12+q*8),
|
arr: make([]byte, 12+q*8),
|
||||||
responder: NewChunkedResponder(opt.Dst),
|
responder: NewChunkedResponder(opt.Dst),
|
||||||
groupBy: opt.GroupBy,
|
groupBy: opt.GroupBy,
|
||||||
|
since: opt.Since,
|
||||||
firstHourOfDay: opt.FirstHourOfDay,
|
firstHourOfDay: opt.FirstHourOfDay,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,9 +182,11 @@ func (s *InstantPeriodsWriter) packBlankPeriod() {
|
|||||||
|
|
||||||
func (s *InstantPeriodsWriter) Close() (err error) {
|
func (s *InstantPeriodsWriter) Close() (err error) {
|
||||||
if s.entries > 0 {
|
if s.entries > 0 {
|
||||||
|
if s.lastTimestamp >= s.since {
|
||||||
s.packPeriod(s.lastTimestamp)
|
s.packPeriod(s.lastTimestamp)
|
||||||
s.responder.AppendRecord(s.arr)
|
s.responder.AppendRecord(s.arr)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return s.responder.Flush()
|
return s.responder.Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user