-
Notifications
You must be signed in to change notification settings - Fork 198
/
node_stats.go
400 lines (363 loc) · 18.7 KB
/
node_stats.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
// Copyright 2014-2022 Aerospike, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package aerospike
import (
"encoding/json"
"sync"
iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic"
hist "github.com/aerospike/aerospike-client-go/v7/types/histogram"
)
// nodeStats keeps track of client's internal node statistics
// These statistics are aggregated once per tend in the cluster object
// and then are served to the end-user.
type nodeStats struct {
m sync.Mutex
// Attempts to open a connection (failed + successful)
ConnectionsAttempts iatomic.Int `json:"connections-attempts"`
// Successful attempts to open a connection
ConnectionsSuccessful iatomic.Int `json:"connections-successful"`
// Failed attempts to use a connection (includes all errors)
ConnectionsFailed iatomic.Int `json:"connections-failed"`
// Connection Timeout errors
ConnectionsTimeoutErrors iatomic.Int `json:"connections-error-timeout"`
// Connection errors other than timeouts
ConnectionsOtherErrors iatomic.Int `json:"connections-error-other"`
// Number of times circuit breaker was hit
CircuitBreakerHits iatomic.Int `json:"circuit-breaker-hits"`
// The command polled the connection pool, but no connections were in the pool
ConnectionsPoolEmpty iatomic.Int `json:"connections-pool-empty"`
// The command offered the connection to the pool, but the pool was full and the connection was closed
ConnectionsPoolOverflow iatomic.Int `json:"connections-pool-overflow"`
// The connection was idle and was dropped
ConnectionsIdleDropped iatomic.Int `json:"connections-idle-dropped"`
// Number of open connections at a given time
ConnectionsOpen iatomic.Int `json:"open-connections"`
// Number of connections that were closed, for any reason (idled out, errored out, etc)
ConnectionsClosed iatomic.Int `json:"closed-connections"`
// Total number of attempted tends (failed + success)
TendsTotal iatomic.Int `json:"tends-total"`
// Total number of successful tends
TendsSuccessful iatomic.Int `json:"tends-successful"`
// Total number of failed tends
TendsFailed iatomic.Int `json:"tends-failed"`
// Total number of partition map updates
PartitionMapUpdates iatomic.Int `json:"partition-map-updates"`
// Total number of times nodes were added to the client (not the same as actual nodes added. Network disruptions between client and server may cause a node being dropped and re-added client-side)
NodeAdded iatomic.Int `json:"node-added-count"`
// Total number of times nodes were removed from the client (not the same as actual nodes removed. Network disruptions between client and server may cause a node being dropped client-side)
NodeRemoved iatomic.Int `json:"node-removed-count"`
// Total number of transaction retries
TransactionRetryCount iatomic.Int `json:"transaction-retry-count"`
// Total number of transaction errors
TransactionErrorCount iatomic.Int `json:"transaction-error-count"`
// Metrics for Get commands
GetMetrics hist.SyncHistogram[uint64] `json:"get-metrics"`
// Metrics for GetHeader commands
GetHeaderMetrics hist.SyncHistogram[uint64] `json:"get-header-metrics"`
// Metrics for Exists commands
ExistsMetrics hist.SyncHistogram[uint64] `json:"exists-metrics"`
// Metrics for Put commands
PutMetrics hist.SyncHistogram[uint64] `json:"put-metrics"`
// Metrics for Delete commands
DeleteMetrics hist.SyncHistogram[uint64] `json:"delete-metrics"`
// Metrics for Operate commands
OperateMetrics hist.SyncHistogram[uint64] `json:"operate-metrics"`
// Metrics for Query commands
QueryMetrics hist.SyncHistogram[uint64] `json:"query-metrics"`
// Metrics for Scan commands
ScanMetrics hist.SyncHistogram[uint64] `json:"scan-metrics"`
// Metrics for UDFMetrics commands
UDFMetrics hist.SyncHistogram[uint64] `json:"udf-metrics"`
// Metrics for Read only Batch commands
BatchReadMetrics hist.SyncHistogram[uint64] `json:"batch-read-metrics"`
// Metrics for Batch commands containing writes
BatchWriteMetrics hist.SyncHistogram[uint64] `json:"batch-write-metrics"`
}
func newNodeStats(policy *MetricsPolicy) *nodeStats {
if policy == nil {
policy = DefaultMetricsPolicy()
}
return &nodeStats{
GetMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns),
GetHeaderMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns),
ExistsMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns),
PutMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns),
DeleteMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns),
OperateMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns),
QueryMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns),
ScanMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns),
UDFMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns),
BatchReadMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns),
BatchWriteMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns),
}
}
// latest returns the latest values to be used in aggregation and then resets the values
func (ns *nodeStats) getAndReset() *nodeStats {
ns.m.Lock()
res := &nodeStats{
ConnectionsAttempts: ns.ConnectionsAttempts.CloneAndSet(0),
ConnectionsSuccessful: ns.ConnectionsSuccessful.CloneAndSet(0),
ConnectionsFailed: ns.ConnectionsFailed.CloneAndSet(0),
ConnectionsTimeoutErrors: ns.ConnectionsTimeoutErrors.CloneAndSet(0),
ConnectionsOtherErrors: ns.ConnectionsOtherErrors.CloneAndSet(0),
CircuitBreakerHits: ns.CircuitBreakerHits.CloneAndSet(0),
ConnectionsPoolEmpty: ns.ConnectionsPoolEmpty.CloneAndSet(0),
ConnectionsPoolOverflow: ns.ConnectionsPoolOverflow.CloneAndSet(0),
ConnectionsIdleDropped: ns.ConnectionsIdleDropped.CloneAndSet(0),
ConnectionsOpen: ns.ConnectionsOpen.CloneAndSet(0),
ConnectionsClosed: ns.ConnectionsClosed.CloneAndSet(0),
TendsTotal: ns.TendsTotal.CloneAndSet(0),
TendsSuccessful: ns.TendsSuccessful.CloneAndSet(0),
TendsFailed: ns.TendsFailed.CloneAndSet(0),
PartitionMapUpdates: ns.PartitionMapUpdates.CloneAndSet(0),
NodeAdded: ns.NodeAdded.CloneAndSet(0),
NodeRemoved: ns.NodeRemoved.CloneAndSet(0),
TransactionRetryCount: ns.TransactionRetryCount.CloneAndSet(0),
TransactionErrorCount: ns.TransactionErrorCount.CloneAndSet(0),
GetMetrics: *ns.GetMetrics.CloneAndReset(),
GetHeaderMetrics: *ns.GetHeaderMetrics.CloneAndReset(),
ExistsMetrics: *ns.ExistsMetrics.CloneAndReset(),
PutMetrics: *ns.PutMetrics.CloneAndReset(),
DeleteMetrics: *ns.DeleteMetrics.CloneAndReset(),
OperateMetrics: *ns.OperateMetrics.CloneAndReset(),
QueryMetrics: *ns.QueryMetrics.CloneAndReset(),
ScanMetrics: *ns.ScanMetrics.CloneAndReset(),
UDFMetrics: *ns.UDFMetrics.CloneAndReset(),
BatchReadMetrics: *ns.BatchReadMetrics.CloneAndReset(),
BatchWriteMetrics: *ns.BatchWriteMetrics.CloneAndReset(),
}
ns.m.Unlock()
return res
}
func (ns *nodeStats) clone() nodeStats {
ns.m.Lock()
res := nodeStats{
ConnectionsAttempts: ns.ConnectionsAttempts.Clone(),
ConnectionsSuccessful: ns.ConnectionsSuccessful.Clone(),
ConnectionsFailed: ns.ConnectionsFailed.Clone(),
ConnectionsTimeoutErrors: ns.ConnectionsTimeoutErrors.Clone(),
ConnectionsOtherErrors: ns.ConnectionsOtherErrors.Clone(),
CircuitBreakerHits: ns.CircuitBreakerHits.Clone(),
ConnectionsPoolEmpty: ns.ConnectionsPoolEmpty.Clone(),
ConnectionsPoolOverflow: ns.ConnectionsPoolOverflow.Clone(),
ConnectionsIdleDropped: ns.ConnectionsIdleDropped.Clone(),
ConnectionsOpen: ns.ConnectionsOpen.Clone(),
ConnectionsClosed: ns.ConnectionsClosed.Clone(),
TendsTotal: ns.TendsTotal.Clone(),
TendsSuccessful: ns.TendsSuccessful.Clone(),
TendsFailed: ns.TendsFailed.Clone(),
PartitionMapUpdates: ns.PartitionMapUpdates.Clone(),
NodeAdded: ns.NodeAdded.Clone(),
NodeRemoved: ns.NodeRemoved.Clone(),
TransactionRetryCount: ns.TransactionRetryCount.Clone(),
TransactionErrorCount: ns.TransactionErrorCount.Clone(),
GetMetrics: *ns.GetMetrics.Clone(),
GetHeaderMetrics: *ns.GetHeaderMetrics.Clone(),
ExistsMetrics: *ns.ExistsMetrics.Clone(),
PutMetrics: *ns.PutMetrics.Clone(),
DeleteMetrics: *ns.DeleteMetrics.Clone(),
OperateMetrics: *ns.OperateMetrics.Clone(),
QueryMetrics: *ns.QueryMetrics.Clone(),
ScanMetrics: *ns.ScanMetrics.Clone(),
UDFMetrics: *ns.UDFMetrics.Clone(),
BatchReadMetrics: *ns.BatchReadMetrics.Clone(),
BatchWriteMetrics: *ns.BatchWriteMetrics.Clone(),
}
ns.m.Unlock()
return res
}
func (ns *nodeStats) reshape(policy *MetricsPolicy) {
ns.m.Lock()
ns.GetMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns)
ns.GetHeaderMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns)
ns.ExistsMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns)
ns.PutMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns)
ns.DeleteMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns)
ns.OperateMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns)
ns.QueryMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns)
ns.ScanMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns)
ns.UDFMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns)
ns.BatchReadMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns)
ns.BatchWriteMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns)
ns.m.Unlock()
}
func (ns *nodeStats) aggregate(newStats *nodeStats) {
ns.m.Lock()
newStats.m.Lock()
ns.ConnectionsAttempts.AddAndGet(newStats.ConnectionsAttempts.Get())
ns.ConnectionsSuccessful.AddAndGet(newStats.ConnectionsSuccessful.Get())
ns.ConnectionsFailed.AddAndGet(newStats.ConnectionsFailed.Get())
ns.ConnectionsTimeoutErrors.AddAndGet(newStats.ConnectionsTimeoutErrors.Get())
ns.ConnectionsOtherErrors.AddAndGet(newStats.ConnectionsOtherErrors.Get())
ns.CircuitBreakerHits.AddAndGet(newStats.CircuitBreakerHits.Get())
ns.ConnectionsPoolEmpty.AddAndGet(newStats.ConnectionsPoolEmpty.Get())
ns.ConnectionsPoolOverflow.AddAndGet(newStats.ConnectionsPoolOverflow.Get())
ns.ConnectionsIdleDropped.AddAndGet(newStats.ConnectionsIdleDropped.Get())
ns.ConnectionsOpen.AddAndGet(newStats.ConnectionsOpen.Get())
ns.ConnectionsClosed.AddAndGet(newStats.ConnectionsClosed.Get())
ns.TendsTotal.AddAndGet(newStats.TendsTotal.Get())
ns.TendsSuccessful.AddAndGet(newStats.TendsSuccessful.Get())
ns.TendsFailed.AddAndGet(newStats.TendsFailed.Get())
ns.PartitionMapUpdates.AddAndGet(newStats.PartitionMapUpdates.Get())
ns.NodeAdded.AddAndGet(newStats.NodeAdded.Get())
ns.NodeRemoved.AddAndGet(newStats.NodeRemoved.Get())
ns.TransactionRetryCount.AddAndGet(newStats.TransactionRetryCount.Get())
ns.TransactionErrorCount.AddAndGet(newStats.TransactionErrorCount.Get())
ns.GetMetrics.Merge(&newStats.GetMetrics)
ns.GetHeaderMetrics.Merge(&newStats.GetHeaderMetrics)
ns.ExistsMetrics.Merge(&newStats.ExistsMetrics)
ns.PutMetrics.Merge(&newStats.PutMetrics)
ns.DeleteMetrics.Merge(&newStats.DeleteMetrics)
ns.OperateMetrics.Merge(&newStats.OperateMetrics)
ns.QueryMetrics.Merge(&newStats.QueryMetrics)
ns.ScanMetrics.Merge(&newStats.ScanMetrics)
ns.UDFMetrics.Merge(&newStats.UDFMetrics)
ns.BatchReadMetrics.Merge(&newStats.BatchReadMetrics)
ns.BatchWriteMetrics.Merge(&newStats.BatchWriteMetrics)
newStats.m.Unlock()
ns.m.Unlock()
}
func (ns nodeStats) MarshalJSON() ([]byte, error) {
return json.Marshal(&struct {
ConnectionsAttempts int `json:"connections-attempts"`
ConnectionsSuccessful int `json:"connections-successful"`
ConnectionsFailed int `json:"connections-failed"`
ConnectionsTimeoutErrors int `json:"connections-error-timeout"`
ConnectionsOtherErrors int `json:"connections-error-other"`
CircuitBreakerHits int `json:"circuit-breaker-hits"`
ConnectionsPoolEmpty int `json:"connections-pool-empty"`
ConnectionsPoolOverflow int `json:"connections-pool-overflow"`
ConnectionsIdleDropped int `json:"connections-idle-dropped"`
ConnectionsOpen int `json:"open-connections"`
ConnectionsClosed int `json:"closed-connections"`
TendsTotal int `json:"tends-total"`
TendsSuccessful int `json:"tends-successful"`
TendsFailed int `json:"tends-failed"`
PartitionMapUpdates int `json:"partition-map-updates"`
NodeAdded int `json:"node-added-count"`
NodeRemoved int `json:"node-removed-count"`
RetryCount int `json:"transaction-retry-count"`
ErrorCount int `json:"transaction-error-count"`
GetMetrics hist.SyncHistogram[uint64] `json:"get-metrics"`
GetHeaderMetrics hist.SyncHistogram[uint64] `json:"get-header-metrics"`
ExistsMetrics hist.SyncHistogram[uint64] `json:"exists-metrics"`
PutMetrics hist.SyncHistogram[uint64] `json:"put-metrics"`
DeleteMetrics hist.SyncHistogram[uint64] `json:"delete-metrics"`
OperateMetrics hist.SyncHistogram[uint64] `json:"operate-metrics"`
QueryMetrics hist.SyncHistogram[uint64] `json:"query-metrics"`
ScanMetrics hist.SyncHistogram[uint64] `json:"scan-metrics"`
UDFMetrics hist.SyncHistogram[uint64] `json:"udf-metrics"`
BatchReadMetrics hist.SyncHistogram[uint64] `json:"batch-read-metrics"`
BatchWriteMetrics hist.SyncHistogram[uint64] `json:"batch-write-metrics"`
}{
ns.ConnectionsAttempts.Get(),
ns.ConnectionsSuccessful.Get(),
ns.ConnectionsFailed.Get(),
ns.ConnectionsTimeoutErrors.Get(),
ns.ConnectionsOtherErrors.Get(),
ns.CircuitBreakerHits.Get(),
ns.ConnectionsPoolEmpty.Get(),
ns.ConnectionsPoolOverflow.Get(),
ns.ConnectionsIdleDropped.Get(),
ns.ConnectionsOpen.Get(),
ns.ConnectionsClosed.Get(),
ns.TendsTotal.Get(),
ns.TendsSuccessful.Get(),
ns.TendsFailed.Get(),
ns.PartitionMapUpdates.Get(),
ns.NodeAdded.Get(),
ns.NodeRemoved.Get(),
ns.TransactionRetryCount.Get(),
ns.TransactionErrorCount.Get(),
ns.GetMetrics,
ns.GetHeaderMetrics,
ns.ExistsMetrics,
ns.PutMetrics,
ns.DeleteMetrics,
ns.OperateMetrics,
ns.QueryMetrics,
ns.ScanMetrics,
ns.UDFMetrics,
ns.BatchReadMetrics,
ns.BatchWriteMetrics,
})
}
func (ns *nodeStats) UnmarshalJSON(data []byte) error {
aux := struct {
ConnectionsAttempts int `json:"connections-attempts"`
ConnectionsSuccessful int `json:"connections-successful"`
ConnectionsFailed int `json:"connections-failed"`
ConnectionsTimeoutErrors int `json:"connections-error-timeout"`
ConnectionsOtherErrors int `json:"connections-error-other"`
CircuitBreakerHits int `json:"circuit-breaker-hits"`
ConnectionsPoolEmpty int `json:"connections-pool-empty"`
ConnectionsPoolOverflow int `json:"connections-pool-overflow"`
ConnectionsIdleDropped int `json:"connections-idle-dropped"`
ConnectionsOpen int `json:"open-connections"`
ConnectionsClosed int `json:"closed-connections"`
TendsTotal int `json:"tends-total"`
TendsSuccessful int `json:"tends-successful"`
TendsFailed int `json:"tends-failed"`
PartitionMapUpdates int `json:"partition-map-updates"`
NodeAdded int `json:"node-added-count"`
NodeRemoved int `json:"node-removed-count"`
RetryCount int `json:"transaction-retry-count"`
ErrorCount int `json:"transaction-error-count"`
GetMetrics hist.SyncHistogram[uint64] `json:"get-metrics"`
GetHeaderMetrics hist.SyncHistogram[uint64] `json:"get-header-metrics"`
ExistsMetrics hist.SyncHistogram[uint64] `json:"exists-metrics"`
PutMetrics hist.SyncHistogram[uint64] `json:"put-metrics"`
DeleteMetrics hist.SyncHistogram[uint64] `json:"delete-metrics"`
OperateMetrics hist.SyncHistogram[uint64] `json:"operate-metrics"`
QueryMetrics hist.SyncHistogram[uint64] `json:"query-metrics"`
ScanMetrics hist.SyncHistogram[uint64] `json:"scan-metrics"`
UDFMetrics hist.SyncHistogram[uint64] `json:"udf-metrics"`
BatchReadMetrics hist.SyncHistogram[uint64] `json:"batch-read-metrics"`
BatchWriteMetrics hist.SyncHistogram[uint64] `json:"batch-write-metrics"`
}{}
if err := json.Unmarshal(data, &aux); err != nil {
return err
}
ns.ConnectionsAttempts.Set(aux.ConnectionsAttempts)
ns.ConnectionsSuccessful.Set(aux.ConnectionsSuccessful)
ns.ConnectionsFailed.Set(aux.ConnectionsFailed)
ns.ConnectionsTimeoutErrors.Set(aux.ConnectionsTimeoutErrors)
ns.ConnectionsOtherErrors.Set(aux.ConnectionsOtherErrors)
ns.CircuitBreakerHits.Set(aux.CircuitBreakerHits)
ns.ConnectionsPoolEmpty.Set(aux.ConnectionsPoolEmpty)
ns.ConnectionsPoolOverflow.Set(aux.ConnectionsPoolOverflow)
ns.ConnectionsIdleDropped.Set(aux.ConnectionsIdleDropped)
ns.ConnectionsOpen.Set(aux.ConnectionsOpen)
ns.ConnectionsClosed.Set(aux.ConnectionsClosed)
ns.TendsTotal.Set(aux.TendsTotal)
ns.TendsSuccessful.Set(aux.TendsSuccessful)
ns.TendsFailed.Set(aux.TendsFailed)
ns.PartitionMapUpdates.Set(aux.PartitionMapUpdates)
ns.NodeAdded.Set(aux.NodeAdded)
ns.NodeRemoved.Set(aux.NodeRemoved)
ns.TransactionRetryCount.Set(aux.RetryCount)
ns.TransactionErrorCount.Set(aux.ErrorCount)
ns.GetMetrics = aux.GetMetrics
ns.GetHeaderMetrics = aux.GetHeaderMetrics
ns.ExistsMetrics = aux.ExistsMetrics
ns.PutMetrics = aux.PutMetrics
ns.DeleteMetrics = aux.DeleteMetrics
ns.OperateMetrics = aux.OperateMetrics
ns.QueryMetrics = aux.QueryMetrics
ns.ScanMetrics = aux.ScanMetrics
ns.UDFMetrics = aux.UDFMetrics
ns.BatchReadMetrics = aux.BatchReadMetrics
ns.BatchWriteMetrics = aux.BatchWriteMetrics
return nil
}