This commit is contained in:
JJ Jordan 2018-03-16 14:50:38 -07:00
Родитель 08223b5cb7
Коммит 9fe20bfab8
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -51,11 +51,13 @@ type baseTelemetry struct {
Tags contracts.ContextTags Tags contracts.ContextTags
} }
// Mixin type for telemetry that includes Measurements.
type baseTelemetryMeasurements struct { type baseTelemetryMeasurements struct {
// Custom measurements // Custom measurements
Measurements map[string]float64 Measurements map[string]float64
} }
// Mixin type for telemetry that omits Measurements.
type baseTelemetryNoMeasurements struct { type baseTelemetryNoMeasurements struct {
} }

Просмотреть файл

@ -59,6 +59,11 @@ func TestTraceTelemetry(t *testing.T) {
checkDataContract(t, "Message", d2.Message, "~my-2nd-message~") checkDataContract(t, "Message", d2.Message, "~my-2nd-message~")
checkDataContract(t, "SeverityLevel", d2.SeverityLevel, Critical) checkDataContract(t, "SeverityLevel", d2.SeverityLevel, Critical)
var telemInterface Telemetry
if telemInterface = telem; telemInterface.GetMeasurements() != nil {
t.Errorf("Trace.(Telemetry).GetMeasurements should return nil")
}
} }
func TestEventTelemetry(t *testing.T) { func TestEventTelemetry(t *testing.T) {
@ -118,6 +123,11 @@ func TestMetricTelemetry(t *testing.T) {
checkDataContract(t, "DataPoint.Value", dp2.Value, 5678.0) checkDataContract(t, "DataPoint.Value", dp2.Value, 5678.0)
checkDataContract(t, "DataPoint.Kind", dp2.Kind, Measurement) checkDataContract(t, "DataPoint.Kind", dp2.Kind, Measurement)
checkDataContract(t, "DataPoint.Count", dp2.Count, 1) checkDataContract(t, "DataPoint.Count", dp2.Count, 1)
var telemInterface Telemetry
if telemInterface = telem; telemInterface.GetMeasurements() != nil {
t.Errorf("Metric.(Telemetry).GetMeasurements should return nil")
}
} }
type statsTest struct { type statsTest struct {