class AggMessageDimension implements MeasurementDimension {


        @Override
        @Generated
        public DimensionDefinition getDefinition() {
            return CommonDimensionDefinition.agg;
        }

        @Override
        @Generated
        public DataType getValueType() {
            return IntType.GLOBAL;
        }

        @Override
        @Generated
        public ConfigMetadata getParams() {
            return historyConfigMetadata;
        }

        @Override
        @Generated
        public boolean isRealTime() {
            return false;
        }

        public AggregationQueryParam createQueryParam(MeasurementParameter parameter) {<FILL_FUNCTION_BODY>}

        @Override
        public Flux<SimpleMeasurementValue> getValue(MeasurementParameter parameter) {
            AggregationQueryParam param = createQueryParam(parameter);

            return Flux.defer(() -> param
                .execute(timeSeriesManager.getService(DeviceTimeSeriesMetric.deviceMetrics())::aggregation)
                .index((index, data) -> SimpleMeasurementValue.of(
                    data.getLong("count",0),
                    data.getString("time").orElse(""),
                    index)))
                .take(param.getLimit());
        }
    }

            return AggregationQueryParam
                .of()
                .sum("count")
                .groupBy(parameter.getInterval("interval", parameter.getInterval("time", null)),
                         parameter.getString("format").orElse("MM月dd日 HH时"))
                .filter(query -> query
                    .where("name", "message-count")
                    .is("productId", parameter.getString("productId").orElse(null))
                )
                .limit(parameter.getInt("limit").orElse(1))
                .from(parameter
                          .getDate("from")
                          .orElseGet(() -> Date
                              .from(LocalDateTime
                                        .now()
                                        .plusDays(-1)
                                        .atZone(ZoneId.systemDefault())
                                        .toInstant())))
                .to(parameter.getDate("to").orElse(new Date()));
        
<methods>public void <init>(org.jetlinks.community.dashboard.MeasurementDefinition) ,public org.jetlinks.community.dashboard.supports.StaticMeasurement addDimension(org.jetlinks.community.dashboard.MeasurementDimension) ,public Mono<org.jetlinks.community.dashboard.MeasurementDimension> getDimension(java.lang.String) ,public Flux<org.jetlinks.community.dashboard.MeasurementDimension> getDimensions() <variables>private org.jetlinks.community.dashboard.MeasurementDefinition definition,private Map<java.lang.String,org.jetlinks.community.dashboard.MeasurementDimension> dimensions