MCPcopy Create free account
hub / github.com/entireio/git-sync / FromStats

Function FromStats

internalbridge/model.go:194–222  ·  view source on GitHub ↗
(stats syncer.Stats)

Source from the content-addressed store, hash-verified

192}
193
194func FromStats(stats syncer.Stats) Stats {
195 out := Stats{Enabled: stats.Enabled, Items: make(map[string]*ServiceStats, len(stats.Items))}
196 for key, item := range stats.Items {
197 copyItem := *item
198 out.Items[key] = &ServiceStats{
199 Name: copyItem.Name,
200 Requests: copyItem.Requests,
201 RequestBytes: copyItem.RequestBytes,
202 ResponseBytes: copyItem.ResponseBytes,
203 Wants: copyItem.Wants,
204 Haves: copyItem.Haves,
205 Commands: copyItem.Commands,
206 }
207 }
208 if len(stats.Sides) > 0 {
209 out.Sides = make([]SideBytes, 0, len(stats.Sides))
210 for _, side := range stats.Sides {
211 out.Sides = append(out.Sides, SideBytes{
212 Label: side.Label,
213 Bytes: side.Bytes,
214 Display: side.Display,
215 ActiveNanos: side.ActiveNanos,
216 IdleNanos: side.IdleNanos,
217 })
218 }
219 }
220 out.ElapsedNanos = stats.ElapsedNanos
221 return out
222}
223
224func FromMeasurement(m syncer.Measurement) Measurement {
225 return Measurement{

Callers 2

FromProbeResultFunction · 0.85
FromSyncResultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected