SetInt sets an integer datum to the provided value and timestamp, or panics if the Datum is not an IntDatum.
(d Datum, v int64, ts time.Time)
| 144 | |
| 145 | // SetInt sets an integer datum to the provided value and timestamp, or panics if the Datum is not an IntDatum. |
| 146 | func SetInt(d Datum, v int64, ts time.Time) { |
| 147 | switch d := d.(type) { |
| 148 | case *Int: |
| 149 | d.Set(v, ts) |
| 150 | case *Buckets: |
| 151 | d.Observe(float64(v), ts) |
| 152 | default: |
| 153 | panic(fmt.Sprintf("datum %v is not an Int", d)) |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | // SetFloat sets a floating-point Datum to the provided value and timestamp, or panics if the Datum is not a FloatDatum. |
| 158 | func SetFloat(d Datum, v float64, ts time.Time) { |