mirror of https://github.com/milvus-io/milvus.git
Signed-off-by: yah01 <yang.cen@zilliz.com>pull/21751/head
parent
072edac01b
commit
2efa11e830
|
@ -417,7 +417,7 @@ func (q *QuotaCenter) getTimeTickDelayFactor(ts Timestamp) float64 {
|
|||
|
||||
t1, _ := tsoutil.ParseTS(ts)
|
||||
for nodeID, metric := range q.queryNodeMetrics {
|
||||
if metric.Fgm.NumFlowGraph > 0 {
|
||||
if metric.Fgm.NumFlowGraph > 0 && metric.Fgm.MinFlowGraphChannel != "" {
|
||||
t2, _ := tsoutil.ParseTS(metric.Fgm.MinFlowGraphTt)
|
||||
delay := t1.Sub(t2)
|
||||
if delay.Nanoseconds() > curMaxDelay.Nanoseconds() {
|
||||
|
@ -430,7 +430,7 @@ func (q *QuotaCenter) getTimeTickDelayFactor(ts Timestamp) float64 {
|
|||
}
|
||||
}
|
||||
for nodeID, metric := range q.dataNodeMetrics {
|
||||
if metric.Fgm.NumFlowGraph > 0 {
|
||||
if metric.Fgm.NumFlowGraph > 0 && metric.Fgm.MinFlowGraphChannel != "" {
|
||||
t2, _ := tsoutil.ParseTS(metric.Fgm.MinFlowGraphTt)
|
||||
delay := t1.Sub(t2)
|
||||
if delay.Nanoseconds() > curMaxDelay.Nanoseconds() {
|
||||
|
|
|
@ -156,8 +156,9 @@ func TestQuotaCenter(t *testing.T) {
|
|||
quotaCenter.tsoAllocator = alloc
|
||||
quotaCenter.queryNodeMetrics = map[UniqueID]*metricsinfo.QueryNodeQuotaMetrics{
|
||||
1: {Fgm: metricsinfo.FlowGraphMetric{
|
||||
MinFlowGraphTt: tsoutil.ComposeTSByTime(now, 0),
|
||||
NumFlowGraph: 1,
|
||||
MinFlowGraphTt: tsoutil.ComposeTSByTime(now, 0),
|
||||
NumFlowGraph: 1,
|
||||
MinFlowGraphChannel: "dml",
|
||||
}}}
|
||||
ts, err := quotaCenter.tsoAllocator.GenerateTSO(1)
|
||||
assert.NoError(t, err)
|
||||
|
@ -173,8 +174,9 @@ func TestQuotaCenter(t *testing.T) {
|
|||
}
|
||||
quotaCenter.queryNodeMetrics = map[UniqueID]*metricsinfo.QueryNodeQuotaMetrics{
|
||||
1: {Fgm: metricsinfo.FlowGraphMetric{
|
||||
MinFlowGraphTt: tsoutil.ComposeTSByTime(now, 0),
|
||||
NumFlowGraph: 1,
|
||||
MinFlowGraphTt: tsoutil.ComposeTSByTime(now, 0),
|
||||
NumFlowGraph: 1,
|
||||
MinFlowGraphChannel: "dml",
|
||||
}}}
|
||||
ts, err = quotaCenter.tsoAllocator.GenerateTSO(1)
|
||||
assert.NoError(t, err)
|
||||
|
@ -209,7 +211,15 @@ func TestQuotaCenter(t *testing.T) {
|
|||
for i, c := range ttCases {
|
||||
Params.QuotaConfig.MaxTimeTickDelay = c.maxTtDelay
|
||||
fgTs := tsoutil.ComposeTSByTime(c.fgTt, 0)
|
||||
quotaCenter.queryNodeMetrics = map[UniqueID]*metricsinfo.QueryNodeQuotaMetrics{1: {Fgm: metricsinfo.FlowGraphMetric{NumFlowGraph: 1, MinFlowGraphTt: fgTs}}}
|
||||
quotaCenter.queryNodeMetrics = map[UniqueID]*metricsinfo.QueryNodeQuotaMetrics{
|
||||
1: {
|
||||
Fgm: metricsinfo.FlowGraphMetric{
|
||||
NumFlowGraph: 1,
|
||||
MinFlowGraphTt: fgTs,
|
||||
MinFlowGraphChannel: "dml",
|
||||
},
|
||||
},
|
||||
}
|
||||
curTs := tsoutil.ComposeTSByTime(c.curTt, 0)
|
||||
factor := quotaCenter.getTimeTickDelayFactor(curTs)
|
||||
if math.Abs(factor-c.expectedFactor) > 0.000001 {
|
||||
|
|
Loading…
Reference in New Issue