summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangwei <[email protected]>2024-10-30 14:23:54 +0800
committerwangwei <[email protected]>2024-10-30 14:23:54 +0800
commita14e8fa0e45be201f949f79006ec3dccf923e39a (patch)
tree3a470647787d7394fee21fe9df90c76fe4831a73
parentd5d1215f27ecf856e1370e6429421e175ad66c4c (diff)
[Fix][dataset] 策略流量趋势数据集增加 bps 指标
-rw-r--r--config/flyway/tsg/R__init_datasets.sql8
1 files changed, 4 insertions, 4 deletions
diff --git a/config/flyway/tsg/R__init_datasets.sql b/config/flyway/tsg/R__init_datasets.sql
index 618a889a..f7379329 100644
--- a/config/flyway/tsg/R__init_datasets.sql
+++ b/config/flyway/tsg/R__init_datasets.sql
@@ -71,11 +71,11 @@ INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`,
INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('traffic-shaping-profile-first-and-last-hit', 'traffic_shaping_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT profile_uuid, DATE_FORMAT( max( __time ), ''%Y-%m-%d %H:%i:%s'' ) AS last_hit, DATE_FORMAT( min( __time ), ''%Y-%m-%d %H:%i:%s'' ) AS first_hit, SUM( in_drop_pkts + out_drop_pkts ) AS drops FROM traffic_shaping_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND profile_uuid IN ( ''${profile_uuid}'' ) AND ( ${filter} ) GROUP BY profile_uuid" }','The time of the first and last hit for shaping profiles.');
INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('traffic-shaping-profile-current-throughput', 'traffic_shaping_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT SUM( in_bytes )* 8 / 5 AS in_bps, SUM( out_bytes )* 8 / 5 AS out_bps, SUM( in_pkts )* 8 / 5 AS in_pps, SUM( out_pkts )* 8 / 5 AS out_pps, APPROX_QUANTILE_HDR(latency_distribution_us, 1) AS max_latency_us, AVG( in_queue_len + out_queue_len ) AS avg_q, MAX( in_queue_len + out_queue_len ) AS max_q FROM traffic_shaping_rule_hits WHERE __time >= FROM_UNIXTIME( UNIX_TIMESTAMP( now())- 15 ) AND __time < FROM_UNIXTIME( UNIX_TIMESTAMP( now())- 10 ) AND vsys_id IN ( ${vsys_id} ) AND profile_uuid IN ( ''${profile_uuid}'' ) AND ( ${filter} )" }','To calculate the current shaping profile hit throughput, the metrics for each appliance are averaged over a 5-second interval. Additionally, the data ingestion latency is also set at 5 seconds.');
INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('traffic-shaping-policy-rule-throughput', 'traffic_shaping_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) AS stat_time, SUM( in_bytes ) AS in_bytes, SUM( out_bytes ) AS out_bytes FROM traffic_shaping_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND rule_uuid IN ( ''${rule_uuid}'' ) AND ( ${filter} ) GROUP BY FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) ORDER BY stat_time ASC LIMIT ${limit}" }','The throughput of traffic shaping rule over a selected time frame');
-INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('traffic-shaping-profile-throughput', 'traffic_shaping_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) AS stat_time, SUM( in_bytes ) AS in_bytes, SUM( out_bytes ) AS out_bytes FROM traffic_shaping_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND profile_uuid IN ( ''${profile_uuid}'' ) AND ( ${filter} ) GROUP BY FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) ORDER BY stat_time ASC LIMIT ${limit}" }','The throughput of traffic shaping profile over a selected time frame');
+INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('traffic-shaping-profile-throughput', 'traffic_shaping_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) AS stat_time, RATE(in_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_in_bits_per_sec, RATE(out_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_out_bits_per_sec, RATE(in_bytes + out_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_bits_per_sec, SUM( in_bytes ) AS in_bytes, SUM( out_bytes ) AS out_bytes FROM traffic_shaping_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND profile_uuid IN ( ''${profile_uuid}'' ) AND ( ${filter} ) GROUP BY FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) ORDER BY stat_time ASC LIMIT ${limit}" }','The throughput of traffic shaping profile over a selected time frame');
INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('service-chaining-policy-rule-throughput-by-rule-id', 'service_chaining_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT FROM_UNIXTIME(TIME_FLOOR_WITH_FILL(UNIX_TIMESTAMP(__time), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'')) AS stat_time, rule_uuid, RATE(sent_bytes + recv_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_bits_per_sec FROM service_chaining_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN (${vsys_id}) AND (${filter}) GROUP BY FROM_UNIXTIME(TIME_FLOOR_WITH_FILL(UNIX_TIMESTAMP(__time), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'')), rule_uuid ORDER BY stat_time ASC LIMIT ${limit}" }','The throughput of the service chaining rule over a selected time frame.');
-INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('service-chaining-policy-rule-transferred-bytes-trend', 'service_chaining_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) AS stat_time, SUM( sent_bytes ) AS sent_bytes, SUM( recv_bytes ) AS received_bytes FROM service_chaining_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND rule_uuid IN ( ''${rule_uuid}'' ) AND ( ${filter} ) GROUP BY FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) ORDER BY stat_time ASC LIMIT ${limit}" }',null);
-INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('service-chaining-function-forwarder-profile-transferred-bytes-trend', 'service_chaining_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) AS stat_time, SUM( sent_bytes ) AS sent_bytes, SUM( recv_bytes ) AS received_bytes FROM service_chaining_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND sff_profile_uuid IN ( ''${sff_profile_uuid}'' ) AND ( ${filter} ) GROUP BY FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) ORDER BY stat_time ASC LIMIT ${limit}" }',null);
-INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('service-chaining-function-profile-transferred-bytes-trend', 'service_chaining_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) AS stat_time, SUM( sent_bytes ) AS sent_bytes, SUM( recv_bytes ) AS received_bytes FROM service_chaining_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND sf_profile_uuid IN ( ''${sf_profile_uuid}'') AND ( ${filter} ) GROUP BY FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) ORDER BY stat_time ASC LIMIT ${limit}" }',null);
+INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('service-chaining-policy-rule-transferred-bytes-trend', 'service_chaining_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) AS stat_time, RATE(recv_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_received_bits_per_sec, RATE(sent_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_sent_bits_per_sec, RATE(recv_bytes + sent_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_bits_per_sec, SUM( sent_bytes ) AS sent_bytes, SUM( recv_bytes ) AS received_bytes FROM service_chaining_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND rule_uuid IN ( ''${rule_uuid}'' ) AND ( ${filter} ) GROUP BY FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) ORDER BY stat_time ASC LIMIT ${limit}" }',null);
+INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('service-chaining-function-forwarder-profile-transferred-bytes-trend', 'service_chaining_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) AS stat_time, RATE(recv_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_received_bits_per_sec, RATE(sent_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_sent_bits_per_sec, RATE(recv_bytes + sent_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_bits_per_sec, SUM( sent_bytes ) AS sent_bytes, SUM( recv_bytes ) AS received_bytes FROM service_chaining_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND sff_profile_uuid IN ( ''${sff_profile_uuid}'' ) AND ( ${filter} ) GROUP BY FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) ORDER BY stat_time ASC LIMIT ${limit}" }',null);
+INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('service-chaining-function-profile-transferred-bytes-trend', 'service_chaining_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) AS stat_time, RATE(recv_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_received_bits_per_sec, RATE(sent_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_sent_bits_per_sec, RATE(recv_bytes + sent_bytes, CHART_GRANULARITY(''${start_time}'', ''${end_time}''), 1) * 8 AS avg_bits_per_sec, SUM( sent_bytes ) AS sent_bytes, SUM( recv_bytes ) AS received_bytes FROM service_chaining_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND sf_profile_uuid IN ( ''${sf_profile_uuid}'') AND ( ${filter} ) GROUP BY FROM_UNIXTIME(TIME_FLOOR_WITH_FILL( UNIX_TIMESTAMP( __time ), CHART_GRANULARITY(''${start_time}'', ''${end_time}''), ''zero'' )) ORDER BY stat_time ASC LIMIT ${limit}" }',null);
INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('service-chaining-policy-rule-statistics', 'service_chaining_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT rule_uuid, SUM(sent_bytes) as sent_bytes, SUM(recv_bytes) as received_bytes, SUM(sent_pkts) as sent_packets, SUM(recv_pkts) as received_packets FROM service_chaining_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND rule_uuid IN ( ''${rule_uuid}'' ) AND ( ${filter} ) GROUP BY rule_uuid" }','The hit count of specific rules.');
INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('service-chaining-function-forwarder-profile-statistics', 'service_chaining_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT sff_profile_uuid, SUM( sent_bytes ) AS sent_bytes, SUM( recv_bytes ) AS received_bytes, SUM( sent_pkts ) AS sent_packets, SUM( recv_pkts ) AS received_packets FROM service_chaining_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND sff_profile_uuid IN ( ''${sff_profile_uuid}'' ) AND ( ${filter} ) GROUP BY sff_profile_uuid" }','The hit count of specific function forwarder profiles.');
INSERT INTO `dataset` (`identifier_name`, `category`, `backend_engine`, `type`, `template`, `description`) VALUES ('service-chaining-function-profile-statistics', 'service_chaining_rule_hits', 'qgw', 'sql', '{ "statement": "SELECT sf_profile_uuid, SUM( sent_bytes ) AS sent_bytes, SUM( recv_bytes ) AS received_bytes, SUM( sent_pkts ) AS sent_packets, SUM( recv_pkts ) AS received_packets FROM service_chaining_rule_hits WHERE __time >= ''${start_time}'' AND __time < ''${end_time}'' AND vsys_id IN ( ${vsys_id} ) AND sf_profile_uuid IN ( ''${sf_profile_uuid}'' ) AND ( ${filter} ) GROUP BY sf_profile_uuid" }','The hit count of specific function profiles.');