Skip to content

Commit

Permalink
make fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
damemi committed May 30, 2023
1 parent 3d50cd8 commit 4030aaa
Show file tree
Hide file tree
Showing 3 changed files with 364 additions and 16 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ release: prepare-release check-clean-work-tree
go run tools/release.go tag

.PHONY: fixtures
fixtures:
fixtures: clean
cd ./exporter/collector/integrationtest && \
go run cmd/recordfixtures/main.go

.PHONY: clean
clean:
rm -rf ./exporter/collector/integrationtest/gcp_metrics_wal
Original file line number Diff line number Diff line change
@@ -1,4 +1,41 @@
{
"createTimeSeriesRequests": [
{
"name": "projects/fakeprojectid",
"timeSeries": [
{
"metric": {
"type": "workload.googleapis.com/testcounter",
"labels": {
"foo": "bar"
}
},
"resource": {
"type": "generic_node",
"labels": {
"location": "global",
"namespace": "",
"node_id": ""
}
},
"metricKind": "CUMULATIVE",
"valueType": "INT64",
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z",
"startTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "253"
}
}
],
"unit": "1"
}
]
}
],
"createMetricDescriptorRequests": [
{
"name": "projects/fakeprojectid",
Expand All @@ -23,6 +60,28 @@
{
"name": "projects/myproject",
"timeSeries": [
{
"metric": {
"type": "custom.googleapis.com/opencensus/googlecloudmonitoring/point_count",
"labels": {
"status": "OK"
}
},
"resource": {
"type": "global"
},
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z",
"startTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "1"
}
}
]
},
{
"metric": {
"type": "custom.googleapis.com/opencensus/grpc.io/client/completed_rpcs",
Expand All @@ -46,6 +105,29 @@
}
]
},
{
"metric": {
"type": "custom.googleapis.com/opencensus/grpc.io/client/completed_rpcs",
"labels": {
"grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries",
"grpc_client_status": "OK"
}
},
"resource": {
"type": "global"
},
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z",
"startTime": "1970-01-01T00:00:00Z"
},
"value": {
"int64Value": "1"
}
}
]
},
{
"metric": {
"type": "custom.googleapis.com/opencensus/grpc.io/client/received_bytes_per_rpc",
Expand Down Expand Up @@ -106,6 +188,66 @@
}
]
},
{
"metric": {
"type": "custom.googleapis.com/opencensus/grpc.io/client/received_bytes_per_rpc",
"labels": {
"grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries"
}
},
"resource": {
"type": "global"
},
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z",
"startTime": "1970-01-01T00:00:00Z"
},
"value": {
"distributionValue": {
"bucketOptions": {
"explicitBuckets": {
"bounds": [
0,
1024,
2048,
4096,
16384,
65536,
262144,
1048576,
4194304,
16777216,
67108864,
268435456,
1073741824,
4294967296
]
}
},
"bucketCounts": [
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0"
]
}
}
}
]
},
{
"metric": {
"type": "custom.googleapis.com/opencensus/grpc.io/client/roundtrip_latency",
Expand Down Expand Up @@ -220,6 +362,120 @@
}
]
},
{
"metric": {
"type": "custom.googleapis.com/opencensus/grpc.io/client/roundtrip_latency",
"labels": {
"grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries"
}
},
"resource": {
"type": "global"
},
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z",
"startTime": "1970-01-01T00:00:00Z"
},
"value": {
"distributionValue": {
"bucketOptions": {
"explicitBuckets": {
"bounds": [
0,
0.01,
0.05,
0.1,
0.3,
0.6,
0.8,
1,
2,
3,
4,
5,
6,
8,
10,
13,
16,
20,
25,
30,
40,
50,
65,
80,
100,
130,
160,
200,
250,
300,
400,
500,
650,
800,
1000,
2000,
5000,
10000,
20000,
50000,
100000
]
}
},
"bucketCounts": [
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0"
]
}
}
}
]
},
{
"metric": {
"type": "custom.googleapis.com/opencensus/grpc.io/client/sent_bytes_per_rpc",
Expand Down Expand Up @@ -279,11 +535,88 @@
}
}
]
},
{
"metric": {
"type": "custom.googleapis.com/opencensus/grpc.io/client/sent_bytes_per_rpc",
"labels": {
"grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries"
}
},
"resource": {
"type": "global"
},
"points": [
{
"interval": {
"endTime": "1970-01-01T00:00:00Z",
"startTime": "1970-01-01T00:00:00Z"
},
"value": {
"distributionValue": {
"bucketOptions": {
"explicitBuckets": {
"bounds": [
0,
1024,
2048,
4096,
16384,
65536,
262144,
1048576,
4194304,
16777216,
67108864,
268435456,
1073741824,
4294967296
]
}
},
"bucketCounts": [
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0"
]
}
}
}
]
}
]
}
],
"createMetricDescriptorRequests": [
{
"name": "projects/myproject",
"metricDescriptor": {
"name": "projects/myproject/metricDescriptors/custom.googleapis.com/opencensus/googlecloudmonitoring/point_count",
"type": "custom.googleapis.com/opencensus/googlecloudmonitoring/point_count",
"labels": [
{
"key": "status"
}
],
"metricKind": "CUMULATIVE",
"valueType": "INT64",
"unit": "1",
"description": "Count of metric points written to Cloud Monitoring.",
"displayName": "OpenCensus/googlecloudmonitoring/point_count"
}
},
{
"name": "projects/myproject",
"metricDescriptor": {
Expand Down
Loading

0 comments on commit 4030aaa

Please sign in to comment.