MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / CleanStats

Method CleanStats

internal/stats/dau_manager.go:228–246  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226}
227
228func (this *DAUManager) CleanStats() error {
229 if !this.isReady {
230 return nil
231 }
232
233 var tr = trackers.Begin("STAT:DAU_CLEAN_STATS")
234 defer tr.End()
235
236 // day
237 {
238 var date = timeutil.Format("Ymd", time.Now().AddDate(0, 0, -2))
239 err := this.ipTable.DeleteRange("server_", "server_"+date)
240 if err != nil {
241 return err
242 }
243 }
244
245 return nil
246}
247
248func (this *DAUManager) Truncate() error {
249 return this.ipTable.Truncate()

Callers 2

InitMethod · 0.95

Calls 4

BeginFunction · 0.92
DeleteRangeMethod · 0.80
FormatMethod · 0.65
EndMethod · 0.45

Tested by 1