| // 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. |
| |
| // This file was auto-generated by the vanadium vdl tool. |
| // Source: types.vdl |
| |
| // Packages stats defines the non-native types exported by the stats service. |
| package stats |
| |
| import ( |
| "v.io/v23/vdl" |
| ) |
| |
| // HistogramValue is the value of Histogram objects. |
| type HistogramValue struct { |
| // Count is the total number of values added to the histogram. |
| Count int64 |
| // Sum is the sum of all the values added to the histogram. |
| Sum int64 |
| // Min is the minimum of all the values added to the histogram. |
| Min int64 |
| // Max is the maximum of all the values added to the histogram. |
| Max int64 |
| // Buckets contains all the buckets of the histogram. |
| Buckets []HistogramBucket |
| } |
| |
| func (HistogramValue) __VDLReflect(struct { |
| Name string `vdl:"v.io/x/ref/services/stats.HistogramValue"` |
| }) { |
| } |
| |
| func (m *HistogramValue) FillVDLTarget(t vdl.Target, tt *vdl.Type) error { |
| |
| if __VDLType_types_v_io_x_ref_services_stats_HistogramValue == nil || __VDLTypetypes0 == nil { |
| panic("Initialization order error: types generated for FillVDLTarget not initialized. Consider moving caller to an init() block.") |
| } |
| fieldsTarget1, err := t.StartFields(tt) |
| if err != nil { |
| return err |
| } |
| |
| keyTarget2, fieldTarget3, err := fieldsTarget1.StartField("Count") |
| if err != vdl.ErrFieldNoExist && err != nil { |
| return err |
| } |
| if err != vdl.ErrFieldNoExist { |
| if err := fieldTarget3.FromInt(int64(m.Count), vdl.Int64Type); err != nil { |
| return err |
| } |
| if err := fieldsTarget1.FinishField(keyTarget2, fieldTarget3); err != nil { |
| return err |
| } |
| } |
| keyTarget4, fieldTarget5, err := fieldsTarget1.StartField("Sum") |
| if err != vdl.ErrFieldNoExist && err != nil { |
| return err |
| } |
| if err != vdl.ErrFieldNoExist { |
| if err := fieldTarget5.FromInt(int64(m.Sum), vdl.Int64Type); err != nil { |
| return err |
| } |
| if err := fieldsTarget1.FinishField(keyTarget4, fieldTarget5); err != nil { |
| return err |
| } |
| } |
| keyTarget6, fieldTarget7, err := fieldsTarget1.StartField("Min") |
| if err != vdl.ErrFieldNoExist && err != nil { |
| return err |
| } |
| if err != vdl.ErrFieldNoExist { |
| if err := fieldTarget7.FromInt(int64(m.Min), vdl.Int64Type); err != nil { |
| return err |
| } |
| if err := fieldsTarget1.FinishField(keyTarget6, fieldTarget7); err != nil { |
| return err |
| } |
| } |
| keyTarget8, fieldTarget9, err := fieldsTarget1.StartField("Max") |
| if err != vdl.ErrFieldNoExist && err != nil { |
| return err |
| } |
| if err != vdl.ErrFieldNoExist { |
| if err := fieldTarget9.FromInt(int64(m.Max), vdl.Int64Type); err != nil { |
| return err |
| } |
| if err := fieldsTarget1.FinishField(keyTarget8, fieldTarget9); err != nil { |
| return err |
| } |
| } |
| keyTarget10, fieldTarget11, err := fieldsTarget1.StartField("Buckets") |
| if err != vdl.ErrFieldNoExist && err != nil { |
| return err |
| } |
| if err != vdl.ErrFieldNoExist { |
| |
| listTarget12, err := fieldTarget11.StartList(__VDLTypetypes1, len(m.Buckets)) |
| if err != nil { |
| return err |
| } |
| for i, elem14 := range m.Buckets { |
| elemTarget13, err := listTarget12.StartElem(i) |
| if err != nil { |
| return err |
| } |
| |
| if err := elem14.FillVDLTarget(elemTarget13, __VDLType_types_v_io_x_ref_services_stats_HistogramBucket); err != nil { |
| return err |
| } |
| if err := listTarget12.FinishElem(elemTarget13); err != nil { |
| return err |
| } |
| } |
| if err := fieldTarget11.FinishList(listTarget12); err != nil { |
| return err |
| } |
| if err := fieldsTarget1.FinishField(keyTarget10, fieldTarget11); err != nil { |
| return err |
| } |
| } |
| if err := t.FinishFields(fieldsTarget1); err != nil { |
| return err |
| } |
| return nil |
| } |
| |
| func (m *HistogramValue) MakeVDLTarget() vdl.Target { |
| return nil |
| } |
| |
| // HistogramBucket is one histogram bucket. |
| type HistogramBucket struct { |
| // LowBound is the lower bound of the bucket. |
| LowBound int64 |
| // Count is the number of values in the bucket. |
| Count int64 |
| } |
| |
| func (HistogramBucket) __VDLReflect(struct { |
| Name string `vdl:"v.io/x/ref/services/stats.HistogramBucket"` |
| }) { |
| } |
| |
| func (m *HistogramBucket) FillVDLTarget(t vdl.Target, tt *vdl.Type) error { |
| |
| if __VDLType_types_v_io_x_ref_services_stats_HistogramBucket == nil || __VDLTypetypes2 == nil { |
| panic("Initialization order error: types generated for FillVDLTarget not initialized. Consider moving caller to an init() block.") |
| } |
| fieldsTarget1, err := t.StartFields(tt) |
| if err != nil { |
| return err |
| } |
| |
| keyTarget2, fieldTarget3, err := fieldsTarget1.StartField("LowBound") |
| if err != vdl.ErrFieldNoExist && err != nil { |
| return err |
| } |
| if err != vdl.ErrFieldNoExist { |
| if err := fieldTarget3.FromInt(int64(m.LowBound), vdl.Int64Type); err != nil { |
| return err |
| } |
| if err := fieldsTarget1.FinishField(keyTarget2, fieldTarget3); err != nil { |
| return err |
| } |
| } |
| keyTarget4, fieldTarget5, err := fieldsTarget1.StartField("Count") |
| if err != vdl.ErrFieldNoExist && err != nil { |
| return err |
| } |
| if err != vdl.ErrFieldNoExist { |
| if err := fieldTarget5.FromInt(int64(m.Count), vdl.Int64Type); err != nil { |
| return err |
| } |
| if err := fieldsTarget1.FinishField(keyTarget4, fieldTarget5); err != nil { |
| return err |
| } |
| } |
| if err := t.FinishFields(fieldsTarget1); err != nil { |
| return err |
| } |
| return nil |
| } |
| |
| func (m *HistogramBucket) MakeVDLTarget() vdl.Target { |
| return nil |
| } |
| |
| func init() { |
| vdl.Register((*HistogramValue)(nil)) |
| vdl.Register((*HistogramBucket)(nil)) |
| } |
| |
| var __VDLTypetypes2 *vdl.Type = vdl.TypeOf((*HistogramBucket)(nil)) |
| var __VDLTypetypes0 *vdl.Type = vdl.TypeOf((*HistogramValue)(nil)) |
| var __VDLTypetypes1 *vdl.Type = vdl.TypeOf([]HistogramBucket(nil)) |
| var __VDLType_types_v_io_x_ref_services_stats_HistogramBucket *vdl.Type = vdl.TypeOf(HistogramBucket{}) |
| var __VDLType_types_v_io_x_ref_services_stats_HistogramValue *vdl.Type = vdl.TypeOf(HistogramValue{}) |
| |
| func __VDLEnsureNativeBuilt_types() { |
| } |