MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / Stats

Method Stats

integrations/gorm/plugin.go:151–167  ·  view source on GitHub ↗

Stats returns a snapshot of all recorded queries.

()

Source from the content-addressed store, hash-verified

149
150// Stats returns a snapshot of all recorded queries.
151func (p *Plugin) Stats() PluginStats {
152 p.mu.Lock()
153 defer p.mu.Unlock()
154 var errCount int
155 for _, q := range p.queries {
156 if !q.ParseOK {
157 errCount++
158 }
159 }
160 qs := make([]QueryRecord, len(p.queries))
161 copy(qs, p.queries)
162 return PluginStats{
163 TotalQueries: len(p.queries),
164 ParseErrors: errCount,
165 Queries: qs,
166 }
167}
168
169// Reset clears all recorded queries.
170func (p *Plugin) Reset() {

Callers 5

TestPlugin_MaxHistoryFunction · 0.80
TestPlugin_OnParseErrorFunction · 0.80

Calls 1

copyFunction · 0.85

Tested by 5

TestPlugin_MaxHistoryFunction · 0.64
TestPlugin_OnParseErrorFunction · 0.64