@@ -236,6 +236,54 @@ CREATE TABLE `SessionMessage` (
236236 INDEX `idx_time` (`f_time`)
237237) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Session Messages';
238238
239+ CREATE TABLE `metrics_data` (
240+ ` id` VARCHAR(64) NOT NULL PRIMARY KEY,
241+ ` application_id` VARCHAR(64) NOT NULL COMMENT 'Application ID',
242+ ` node_endpoint` VARCHAR(255) NOT NULL COMMENT 'Node endpoint',
243+ ` connections_current` BIGINT DEFAULT 0,
244+ ` subscriptions_current` BIGINT DEFAULT 0,
245+ ` messages_received_total` BIGINT DEFAULT 0,
246+ ` messages_sent_total` BIGINT DEFAULT 0,
247+ ` messages_published_total` BIGINT DEFAULT 0,
248+ ` connect_events` BIGINT DEFAULT 0,
249+ ` disconnect_events` BIGINT DEFAULT 0,
250+ ` subscribe_events` BIGINT DEFAULT 0,
251+ ` unsubscribe_events` BIGINT DEFAULT 0,
252+ ` jvm_memory_used` BIGINT DEFAULT 0,
253+ ` jvm_memory_max` BIGINT DEFAULT 0,
254+ ` jvm_memory_committed` BIGINT DEFAULT 0,
255+ ` jvm_heap_used` BIGINT DEFAULT 0,
256+ ` jvm_heap_max` BIGINT DEFAULT 0,
257+ ` jvm_heap_committed` BIGINT DEFAULT 0,
258+ ` jvm_nonheap_used` BIGINT DEFAULT 0,
259+ ` jvm_nonheap_max` BIGINT DEFAULT 0,
260+ ` jvm_nonheap_committed` BIGINT DEFAULT 0,
261+ ` jvm_metaspace_used` BIGINT DEFAULT 0,
262+ ` jvm_metaspace_max` BIGINT DEFAULT 0,
263+ ` jvm_metaspace_committed` BIGINT DEFAULT 0,
264+ ` jvm_codecache_used` BIGINT DEFAULT 0,
265+ ` jvm_codecache_max` BIGINT DEFAULT 0,
266+ ` jvm_codecache_committed` BIGINT DEFAULT 0,
267+ ` jvm_compressed_class_space_used` BIGINT DEFAULT 0,
268+ ` jvm_compressed_class_space_max` BIGINT DEFAULT 0,
269+ ` jvm_compressed_class_space_committed` BIGINT DEFAULT 0,
270+ ` jvm_gc_count` BIGINT DEFAULT 0,
271+ ` jvm_gc_time` BIGINT DEFAULT 0,
272+ ` jvm_threads_current` BIGINT DEFAULT 0,
273+ ` jvm_threads_daemon` BIGINT DEFAULT 0,
274+ ` jvm_threads_peak` BIGINT DEFAULT 0,
275+ ` jvm_threads_deadlocked` BIGINT DEFAULT 0,
276+ ` jvm_classes_loaded` BIGINT DEFAULT 0,
277+ ` jvm_classes_unloaded` BIGINT DEFAULT 0,
278+ ` process_cpu_usage` DOUBLE DEFAULT 0,
279+ ` system_cpu_usage` DOUBLE DEFAULT 0,
280+ ` uptime` BIGINT DEFAULT 0,
281+ ` collected_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
282+ INDEX `idx_metrics_app` (`application_id`),
283+ INDEX `idx_metrics_collected` (`collected_at`),
284+ INDEX `idx_metrics_app_node` (`application_id`, `node_endpoint`)
285+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Historical monitoring metrics';
286+
239287CREATE TABLE `ProtocolExtensionInfo` (
240288 ` id` VARCHAR(64) NOT NULL PRIMARY KEY,
241289 ` f_protocol_type` VARCHAR(50) NOT NULL COMMENT 'Protocol type',
@@ -482,6 +530,54 @@ CREATE TABLE "SessionMessage" (
482530CREATE INDEX "idx_sessionmsg_client" ON "SessionMessage"("f_client_id");
483531CREATE INDEX "idx_sessionmsg_time" ON "SessionMessage"("f_time");
484532
533+ CREATE TABLE "metrics_data" (
534+ " id" VARCHAR(64) PRIMARY KEY,
535+ " application_id" VARCHAR(64) NOT NULL,
536+ " node_endpoint" VARCHAR(255) NOT NULL,
537+ " connections_current" BIGINT DEFAULT 0,
538+ " subscriptions_current" BIGINT DEFAULT 0,
539+ " messages_received_total" BIGINT DEFAULT 0,
540+ " messages_sent_total" BIGINT DEFAULT 0,
541+ " messages_published_total" BIGINT DEFAULT 0,
542+ " connect_events" BIGINT DEFAULT 0,
543+ " disconnect_events" BIGINT DEFAULT 0,
544+ " subscribe_events" BIGINT DEFAULT 0,
545+ " unsubscribe_events" BIGINT DEFAULT 0,
546+ " jvm_memory_used" BIGINT DEFAULT 0,
547+ " jvm_memory_max" BIGINT DEFAULT 0,
548+ " jvm_memory_committed" BIGINT DEFAULT 0,
549+ " jvm_heap_used" BIGINT DEFAULT 0,
550+ " jvm_heap_max" BIGINT DEFAULT 0,
551+ " jvm_heap_committed" BIGINT DEFAULT 0,
552+ " jvm_nonheap_used" BIGINT DEFAULT 0,
553+ " jvm_nonheap_max" BIGINT DEFAULT 0,
554+ " jvm_nonheap_committed" BIGINT DEFAULT 0,
555+ " jvm_metaspace_used" BIGINT DEFAULT 0,
556+ " jvm_metaspace_max" BIGINT DEFAULT 0,
557+ " jvm_metaspace_committed" BIGINT DEFAULT 0,
558+ " jvm_codecache_used" BIGINT DEFAULT 0,
559+ " jvm_codecache_max" BIGINT DEFAULT 0,
560+ " jvm_codecache_committed" BIGINT DEFAULT 0,
561+ " jvm_compressed_class_space_used" BIGINT DEFAULT 0,
562+ " jvm_compressed_class_space_max" BIGINT DEFAULT 0,
563+ " jvm_compressed_class_space_committed" BIGINT DEFAULT 0,
564+ " jvm_gc_count" BIGINT DEFAULT 0,
565+ " jvm_gc_time" BIGINT DEFAULT 0,
566+ " jvm_threads_current" BIGINT DEFAULT 0,
567+ " jvm_threads_daemon" BIGINT DEFAULT 0,
568+ " jvm_threads_peak" BIGINT DEFAULT 0,
569+ " jvm_threads_deadlocked" BIGINT DEFAULT 0,
570+ " jvm_classes_loaded" BIGINT DEFAULT 0,
571+ " jvm_classes_unloaded" BIGINT DEFAULT 0,
572+ " process_cpu_usage" DOUBLE PRECISION DEFAULT 0,
573+ " system_cpu_usage" DOUBLE PRECISION DEFAULT 0,
574+ " uptime" BIGINT DEFAULT 0,
575+ " collected_at" TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
576+ );
577+ CREATE INDEX IF NOT EXISTS idx_metrics_app ON "metrics_data"("application_id");
578+ CREATE INDEX IF NOT EXISTS idx_metrics_collected ON "metrics_data"("collected_at");
579+ CREATE INDEX IF NOT EXISTS idx_metrics_app_node ON "metrics_data"("application_id", "node_endpoint");
580+
485581CREATE TABLE "ProtocolExtensionInfo" (
486582 " id" VARCHAR(64) NOT NULL PRIMARY KEY,
487583 " f_protocol_type" VARCHAR(50) NOT NULL,
0 commit comments