| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // NewInteger creates a new Integer StatsObject with the given name and |
| // returns a pointer to it. |
| func NewInteger(name string) *Integer { |
| node := findNodeLocked(name, true) |
| // Integer implements the StatsObject interface. |
| // Set sets the value of the object. |
| func (i *Integer) Set(value int64) { |
| i.lastUpdate = time.Now() |
| // Incr increments the value of the object. |
| func (i *Integer) Incr(delta int64) { |
| i.lastUpdate = time.Now() |
| // LastUpdate returns the time at which the object was last updated. |
| func (i *Integer) LastUpdate() time.Time { |
| // Value returns the current value of the object. |
| func (i *Integer) Value() interface{} { |