Привет, ребята, я работаю над приложением, использующим облачную платформу Google. Я использую приведенный ниже код для получения показателей в системе, и я хотел бы отобразить показатели в виде графика на веб-сайте реакции. Проблема для 12-часового небольшого метри c GCP отправляет мне json с 5000 строками с кучей вещей, и я понятия не имею, как это отфильтровать. Я просто хотел бы, чтобы несколько точек с отметками времени и значениями поместили на простой график. Он отправляет оооочень много материала, и большая его часть бессмысленна.
try (MetricServiceClient client = MetricServiceClient.create()) {
ProjectName name = ProjectName.of("geotrails");
TimeInterval interval = TimeInterval.newBuilder().setStartTime(Timestamps.fromMillis(start))
.setEndTime(Timestamps.fromMillis(System.currentTimeMillis())).build();
ListTimeSeriesRequest request = ListTimeSeriesRequest.newBuilder().setName(name.toString())
.setFilter(stats.filter()).setInterval(interval).build();
ListTimeSeriesPagedResponse response = client.listTimeSeries(request);
return Lists.newArrayList(response.iterateAll());
} catch (IOException e) {
throw new InternalServerException("");
}
Вот образец из строк вывода спама (id показывает все, кроме 30k символов, это максимум, а id - 200k)
[
{
"metric_": {
"bitField0_": 0,
"type_": "appengine.googleapis.com/system/instance_count",
"labels_": {
"isMutable": true,
"mode": "MAP",
"mapData": {
"state": ""
},
"converter": {}
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"resource_": {
"bitField0_": 0,
"type_": "gae_app",
"labels_": {
"isMutable": true,
"mode": "MAP",
"mapData": {
"version_id": "1",
"module_id": "default",
"project_id": "geotrails",
"zone": "europe-west6-3"
},
"converter": {}
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"metricKind_": 1,
"valueType_": 2,
"points_": [
{
"interval_": {
"endTime_": {
"seconds_": 1590710460,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590710460,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590710400,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590710400,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590710340,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590710340,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590710280,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590710280,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590710220,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590710220,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590710160,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590710160,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590710100,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590710100,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590710040,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590710040,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590709980,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590709980,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590709920,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590709920,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590709860,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590709860,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590709800,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590709800,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590709740,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590709740,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590709680,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590709680,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590709620,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590709620,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590709560,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590709560,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590709500,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590709500,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
{
"interval_": {
"endTime_": {
"seconds_": 1590709440,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"startTime_": {
"seconds_": 1590709440,
"nanos_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"value_": {
"valueCase_": 2,
"value_": 0,
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
},
"memoizedIsInitialized": -1,
"unknownFields": {
"fields": {},
"fieldsDescending": {}
},
"memoizedSize": -1,
"memoizedHashCode": 0
}
Есть подсказка?