From 470c35495b49e4d7b5daff8e20cc22fd16743b39 Mon Sep 17 00:00:00 2001 From: Matt Woodward Date: Thu, 1 Feb 2024 23:11:24 +1100 Subject: [PATCH] Generate more things that somehow got missed --- ...iling_MsgProfilingResourceCounterTest.java | 797 ++++++++++++++++++ ..._profiling_MsgProfilingSystemInfoTest.java | 88 ++ ..._profiling_MsgProfilingThreadInfoTest.java | Bin 0 -> 4834 bytes jsonschema/MsgProfilingResourceCounter.json | 28 + jsonschema/MsgProfilingSystemInfo.json | 30 + jsonschema/MsgProfilingThreadInfo.json | 34 + jsonschema/ResourceBucket.json | 40 + sbpjson/elm/SbpJson.elm | 158 +++- sbpjson/javascript/SbpJson.js | 74 ++ sbpjson/typescript/SbpJson.ts | 124 ++- 10 files changed, 1371 insertions(+), 2 deletions(-) create mode 100644 java/test/auto_check_sbp_profiling_MsgProfilingResourceCounterTest.java create mode 100644 java/test/auto_check_sbp_profiling_MsgProfilingSystemInfoTest.java create mode 100644 java/test/auto_check_sbp_profiling_MsgProfilingThreadInfoTest.java create mode 100644 jsonschema/MsgProfilingResourceCounter.json create mode 100644 jsonschema/MsgProfilingSystemInfo.json create mode 100644 jsonschema/MsgProfilingThreadInfo.json create mode 100644 jsonschema/ResourceBucket.json diff --git a/java/test/auto_check_sbp_profiling_MsgProfilingResourceCounterTest.java b/java/test/auto_check_sbp_profiling_MsgProfilingResourceCounterTest.java new file mode 100644 index 000000000..21a438bcf --- /dev/null +++ b/java/test/auto_check_sbp_profiling_MsgProfilingResourceCounterTest.java @@ -0,0 +1,797 @@ +/* Copyright (C) 2015-2022 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ +package com.swiftnav.sbp.test; + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/profiling/test_MsgProfilingResourceCounter.yaml by generate.py. Do +// not modify by hand! + + +import com.swiftnav.sbp.SBPMessage; +import com.swiftnav.sbp.profiling.MsgProfilingResourceCounter; +import java.math.BigInteger; +import org.json.JSONObject; +import org.junit.Test; + +public class auto_check_sbp_profiling_MsgProfilingResourceCounterTest { + + public static boolean debug = false; + private static final double DELTA = 1e-15; + + @Test + public void test1() throws Throwable { + if (debug) + System.out.format( + "%n%s%n", "auto_check_sbp_profiling_MsgProfilingResourceCounterTest.test1"); + byte[] payload = + new byte[] { + (byte) 1, + (byte) 3, + (byte) 70, + (byte) 117, + (byte) 115, + (byte) 105, + (byte) 111, + (byte) 110, + (byte) 32, + (byte) 101, + (byte) 110, + (byte) 103, + (byte) 105, + (byte) 110, + (byte) 101, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 2, + (byte) 0, + (byte) 248, + (byte) 38, + (byte) 14, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 78, + (byte) 84, + (byte) 82, + (byte) 73, + (byte) 80, + (byte) 32, + (byte) 99, + (byte) 108, + (byte) 105, + (byte) 101, + (byte) 110, + (byte) 116, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 1, + (byte) 1, + (byte) 1, + (byte) 1, + (byte) 230, + (byte) 73, + (byte) 1, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 111, + (byte) 3, + (byte) 0, + (byte) 0, + (byte) 64, + (byte) 76, + (byte) 0, + (byte) 0, + (byte) 83, + (byte) 83, + (byte) 82, + (byte) 50, + (byte) 79, + (byte) 83, + (byte) 82, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 1, + (byte) 1, + (byte) 1, + (byte) 0, + (byte) 72, + (byte) 13, + (byte) 66, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 80, + (byte) 101, + (byte) 114, + (byte) 105, + (byte) 111, + (byte) 100, + (byte) 105, + (byte) 99, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 1, + (byte) 0, + (byte) 72, + (byte) 197, + (byte) 3, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 73, + (byte) 77, + (byte) 85, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 1, + (byte) 1, + (byte) 1, + (byte) 1, + (byte) 129, + (byte) 71, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 95, + (byte) 102, + (byte) 0, + (byte) 0, + (byte) 115, + (byte) 98, + (byte) 112, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 5, + (byte) 2, + (byte) 2, + (byte) 2, + (byte) 243, + (byte) 169, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 0, + (byte) 187, + (byte) 151, + (byte) 3, + (byte) 0, + (byte) 242, + (byte) 1, + (byte) 0, + (byte) 0, + }; + SBPMessage sbp = new SBPMessage(0x1000, 0xcf03, payload); + MsgProfilingResourceCounter msg = new MsgProfilingResourceCounter(sbp); + JSONObject json = msg.toJSON(); + Number value; + Number expected; + value = msg.buckets[0].cv; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[0].cv + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[0].heap_bytes_alloc; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[0].heap_bytes_alloc + "' != '" + 927480 + "'", + value.equals(BigInteger.valueOf(927480L))); + } else { + value = value.longValue(); + expected = 927480L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[0].heap_bytes_free; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[0].heap_bytes_free + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[0].io; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[0].io + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[0].io_read; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[0].io_read + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[0].io_write; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[0].io_write + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[0].mutex; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[0].mutex + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + org.junit.Assert.assertEquals(msg.buckets[0].name, "Fusion engine"); + value = msg.buckets[0].thread; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[0].thread + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[1].cv; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[1].cv + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[1].heap_bytes_alloc; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[1].heap_bytes_alloc + "' != '" + 84454 + "'", + value.equals(BigInteger.valueOf(84454L))); + } else { + value = value.longValue(); + expected = 84454L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[1].heap_bytes_free; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[1].heap_bytes_free + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[1].io; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[1].io + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[1].io_read; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[1].io_read + "' != '" + 19520 + "'", + value.equals(BigInteger.valueOf(19520L))); + } else { + value = value.longValue(); + expected = 19520L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[1].io_write; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[1].io_write + "' != '" + 879 + "'", + value.equals(BigInteger.valueOf(879L))); + } else { + value = value.longValue(); + expected = 879L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[1].mutex; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[1].mutex + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + org.junit.Assert.assertEquals(msg.buckets[1].name, "NTRIP client"); + value = msg.buckets[1].thread; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[1].thread + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[2].cv; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[2].cv + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[2].heap_bytes_alloc; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[2].heap_bytes_alloc + "' != '" + 4328776 + "'", + value.equals(BigInteger.valueOf(4328776L))); + } else { + value = value.longValue(); + expected = 4328776L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[2].heap_bytes_free; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[2].heap_bytes_free + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[2].io; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[2].io + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[2].io_read; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[2].io_read + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[2].io_write; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[2].io_write + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[2].mutex; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[2].mutex + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + org.junit.Assert.assertEquals(msg.buckets[2].name, "SSR2OSR"); + value = msg.buckets[2].thread; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[2].thread + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[3].cv; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[3].cv + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[3].heap_bytes_alloc; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[3].heap_bytes_alloc + "' != '" + 247112 + "'", + value.equals(BigInteger.valueOf(247112L))); + } else { + value = value.longValue(); + expected = 247112L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[3].heap_bytes_free; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[3].heap_bytes_free + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[3].io; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[3].io + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[3].io_read; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[3].io_read + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[3].io_write; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[3].io_write + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[3].mutex; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[3].mutex + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + org.junit.Assert.assertEquals(msg.buckets[3].name, "Periodic"); + value = msg.buckets[3].thread; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[3].thread + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[4].cv; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[4].cv + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[4].heap_bytes_alloc; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[4].heap_bytes_alloc + "' != '" + 18305 + "'", + value.equals(BigInteger.valueOf(18305L))); + } else { + value = value.longValue(); + expected = 18305L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[4].heap_bytes_free; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[4].heap_bytes_free + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[4].io; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[4].io + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[4].io_read; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[4].io_read + "' != '" + 26207 + "'", + value.equals(BigInteger.valueOf(26207L))); + } else { + value = value.longValue(); + expected = 26207L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[4].io_write; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[4].io_write + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[4].mutex; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[4].mutex + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + org.junit.Assert.assertEquals(msg.buckets[4].name, "IMU"); + value = msg.buckets[4].thread; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[4].thread + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[5].cv; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[5].cv + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[5].heap_bytes_alloc; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[5].heap_bytes_alloc + "' != '" + 43507 + "'", + value.equals(BigInteger.valueOf(43507L))); + } else { + value = value.longValue(); + expected = 43507L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[5].heap_bytes_free; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[5].heap_bytes_free + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[5].io; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[5].io + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[5].io_read; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[5].io_read + "' != '" + 498 + "'", + value.equals(BigInteger.valueOf(498L))); + } else { + value = value.longValue(); + expected = 498L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[5].io_write; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[5].io_write + "' != '" + 235451 + "'", + value.equals(BigInteger.valueOf(235451L))); + } else { + value = value.longValue(); + expected = 235451L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.buckets[5].mutex; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[5].mutex + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + org.junit.Assert.assertEquals(msg.buckets[5].name, "sbp"); + value = msg.buckets[5].thread; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.buckets[5].thread + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.seq_len; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.seq_len + "' != '" + 3 + "'", value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.seq_no; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.seq_no + "' != '" + 1 + "'", value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + + org.junit.Assert.assertNotEquals("", msg.getFriendlyName()); + } +} diff --git a/java/test/auto_check_sbp_profiling_MsgProfilingSystemInfoTest.java b/java/test/auto_check_sbp_profiling_MsgProfilingSystemInfoTest.java new file mode 100644 index 000000000..ea69c129a --- /dev/null +++ b/java/test/auto_check_sbp_profiling_MsgProfilingSystemInfoTest.java @@ -0,0 +1,88 @@ +/* Copyright (C) 2015-2022 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ +package com.swiftnav.sbp.test; + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/profiling/test_MsgProfilingSystemInfo.yaml by generate.py. Do not +// modify by hand! + + +import com.swiftnav.sbp.SBPMessage; +import com.swiftnav.sbp.profiling.MsgProfilingSystemInfo; +import java.math.BigInteger; +import org.json.JSONObject; +import org.junit.Test; + +public class auto_check_sbp_profiling_MsgProfilingSystemInfoTest { + + public static boolean debug = false; + private static final double DELTA = 1e-15; + + @Test + public void test1() throws Throwable { + if (debug) + System.out.format( + "%n%s%n", "auto_check_sbp_profiling_MsgProfilingSystemInfoTest.test1"); + byte[] payload = + new byte[] { + (byte) 98, (byte) 40, (byte) 52, (byte) 0, (byte) 0, (byte) 0, (byte) 0, + (byte) 0, (byte) 114, (byte) 12, (byte) 157, (byte) 0, (byte) 0, (byte) 0, + (byte) 0, (byte) 0, (byte) 27, (byte) 72, (byte) 195, (byte) 226, (byte) 0, + }; + SBPMessage sbp = new SBPMessage(0x1000, 0xcf01, payload); + MsgProfilingSystemInfo msg = new MsgProfilingSystemInfo(sbp); + JSONObject json = msg.toJSON(); + Number value; + Number expected; + value = msg.age; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.age + "' != '" + 10292338 + "'", + value.equals(BigInteger.valueOf(10292338L))); + } else { + value = value.longValue(); + expected = 10292338L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.heap_usage; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.heap_usage + "' != '" + 14861128 + "'", + value.equals(BigInteger.valueOf(14861128L))); + } else { + value = value.longValue(); + expected = 14861128L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.n_threads; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.n_threads + "' != '" + 27 + "'", + value.equals(BigInteger.valueOf(27L))); + } else { + value = value.longValue(); + expected = 27L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.total_cpu_time; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.total_cpu_time + "' != '" + 3418210 + "'", + value.equals(BigInteger.valueOf(3418210L))); + } else { + value = value.longValue(); + expected = 3418210L; + org.junit.Assert.assertEquals(value, expected); + } + + org.junit.Assert.assertNotEquals("", msg.getFriendlyName()); + } +} diff --git a/java/test/auto_check_sbp_profiling_MsgProfilingThreadInfoTest.java b/java/test/auto_check_sbp_profiling_MsgProfilingThreadInfoTest.java new file mode 100644 index 0000000000000000000000000000000000000000..89ca33b4a820f266d6aca900c63b12b26932cc8b GIT binary patch literal 4834 zcmd5={cqYv7~aqP6>pKMz?vGHmXfrpGy=}*jo1jBcGWaRhdG;T%^mZdNm-Tueed~$ zk2Nux(zLarkh~wy`*nBEnbyzH7t3|RqPc=bzX@&A>O5_m?KVuVS*XAzD;5#O1P6x) zMh&zBS0qp`VXo9tzHGH*x?GAx8B%+2vN8g(KtpZo&zS@%(j=gu|4OGHXrMp|P;&|~ z3n-TqLXq+rFrEoR7E?GHI(^%n*hg?ZXTcm6sZ<(oO7+i-NtLi^s^|=%B8pfETr)LC zfK5CDdT|UQ(`EHZNT{UAiq3QyS$1!n3G}^z4Lx@Nj(hHnFM7V?xq$M~*n8^?>;cq! z6a2pp?;QV)cj?2s-gw+|{rBLVqu+b@-EjxU8qP)odkpp;qp>}ipr0KF^n$9BX45sB3rd32|kjD0*+)mA30qbic0mWR%^BL8D(9+CK5=h z#M6j!nh@RIFu_@(kzCTCrF~>;O%`#hoOKJaTFXSBKjTqmadjc1Q7Q4~2_-X!hr-Z) zFkM3lZYrHjkYyt&+=(#h$dLpDel`_oSj)%qW_=E|Dx zle5)6xd(RJtoH6as|0^usjV)nTdlUNZY8*7Rj&ifJfOD@Y^?*U^jW()J@bC>mRa5T z!{r@l?}7Yo@xIxfe_Q$kq!v8m^?A1yHq1|!X`07iehNafeOw-tJ16Mvln4u{2}Yyc zZqUGRJ1ARD1kI7?iU5WZTHe^PbJN8X?`JC#rv-88Be#&!Pk6Dwi^jIR%&q{-D84+P zH4EiR#*y-PKt%{!(r)e$mUhXwJLBh`#A}~2ke2boPf~gZPaW0aNmhftFg=0#5j=Vg znb5*p@#*ufnMv!nue~fagZ`Z&K{vK(8JXM*8zsiD+1zQ)4N&Cs|D;~FAcu?vkKXF$ z?KV|cSoRK^wE^Guv7!fdo@54pyn)%xYD0^6bg@9t1LtHxk=oBwsb3N(j~J&v?ecY5 zjW)))=^GLIXJ;jRySZ+o?~nK7*~!TZ^W;9$Eg&9bxFz=2p6!=|N%Kp!UOM{u)|1J? z?~kV4?VPsnweNC-2N_HO{lIfk-)pbntHu5)SZt8|D6cx|9;DmW@F5$mgd*`(uuQKM zTYQ&}?`N>z`WM}kZnsnPe{(qJyEOluZRU!Z String msgPpsTimeToString r = Jenc.encode 0 (encodeMsgPpsTime r) +msgProfilingResourceCounterToString : MsgProfilingResourceCounter -> String +msgProfilingResourceCounterToString r = Jenc.encode 0 (encodeMsgProfilingResourceCounter r) + +msgProfilingSystemInfoToString : MsgProfilingSystemInfo -> String +msgProfilingSystemInfoToString r = Jenc.encode 0 (encodeMsgProfilingSystemInfo r) + +msgProfilingThreadInfoToString : MsgProfilingThreadInfo -> String +msgProfilingThreadInfoToString r = Jenc.encode 0 (encodeMsgProfilingThreadInfo r) + msgProtectionLevelToString : MsgProtectionLevel -> String msgProtectionLevelToString r = Jenc.encode 0 (encodeMsgProtectionLevel r) @@ -4126,6 +4199,9 @@ periodToString r = Jenc.encode 0 (encodePeriod r) phaseBiasesContentToString : PhaseBiasesContent -> String phaseBiasesContentToString r = Jenc.encode 0 (encodePhaseBiasesContent r) +resourceBucketToString : ResourceBucket -> String +resourceBucketToString r = Jenc.encode 0 (encodeResourceBucket r) + stecHeaderToString : STECHeader -> String stecHeaderToString r = Jenc.encode 0 (encodeSTECHeader r) @@ -6589,6 +6665,86 @@ encodeMsgPpsTime x = , ("time", Jenc.int x.time) ] +msgProfilingResourceCounter : Jdec.Decoder MsgProfilingResourceCounter +msgProfilingResourceCounter = + Jpipe.decode MsgProfilingResourceCounter + |> Jpipe.required "buckets" (Jdec.array resourceBucket) + |> Jpipe.required "seq_len" Jdec.int + |> Jpipe.required "seq_no" Jdec.int + +encodeMsgProfilingResourceCounter : MsgProfilingResourceCounter -> Jenc.Value +encodeMsgProfilingResourceCounter x = + Jenc.object + [ ("buckets", makeArrayEncoder encodeResourceBucket x.buckets) + , ("seq_len", Jenc.int x.seqLen) + , ("seq_no", Jenc.int x.seqNo) + ] + +resourceBucket : Jdec.Decoder ResourceBucket +resourceBucket = + Jpipe.decode ResourceBucket + |> Jpipe.required "cv" Jdec.int + |> Jpipe.required "heap_bytes_alloc" Jdec.int + |> Jpipe.required "heap_bytes_free" Jdec.int + |> Jpipe.required "io" Jdec.int + |> Jpipe.required "io_read" Jdec.int + |> Jpipe.required "io_write" Jdec.int + |> Jpipe.required "mutex" Jdec.int + |> Jpipe.required "name" Jdec.string + |> Jpipe.required "thread" Jdec.int + +encodeResourceBucket : ResourceBucket -> Jenc.Value +encodeResourceBucket x = + Jenc.object + [ ("cv", Jenc.int x.cv) + , ("heap_bytes_alloc", Jenc.int x.heapBytesAlloc) + , ("heap_bytes_free", Jenc.int x.heapBytesFree) + , ("io", Jenc.int x.io) + , ("io_read", Jenc.int x.ioRead) + , ("io_write", Jenc.int x.ioWrite) + , ("mutex", Jenc.int x.mutex) + , ("name", Jenc.string x.name) + , ("thread", Jenc.int x.thread) + ] + +msgProfilingSystemInfo : Jdec.Decoder MsgProfilingSystemInfo +msgProfilingSystemInfo = + Jpipe.decode MsgProfilingSystemInfo + |> Jpipe.required "age" Jdec.int + |> Jpipe.required "heap_usage" Jdec.int + |> Jpipe.required "n_threads" Jdec.int + |> Jpipe.required "total_cpu_time" Jdec.int + +encodeMsgProfilingSystemInfo : MsgProfilingSystemInfo -> Jenc.Value +encodeMsgProfilingSystemInfo x = + Jenc.object + [ ("age", Jenc.int x.age) + , ("heap_usage", Jenc.int x.heapUsage) + , ("n_threads", Jenc.int x.nThreads) + , ("total_cpu_time", Jenc.int x.totalCPUTime) + ] + +msgProfilingThreadInfo : Jdec.Decoder MsgProfilingThreadInfo +msgProfilingThreadInfo = + Jpipe.decode MsgProfilingThreadInfo + |> Jpipe.required "age" Jdec.int + |> Jpipe.required "name" Jdec.string + |> Jpipe.required "stack_size" Jdec.int + |> Jpipe.required "stack_usage" Jdec.int + |> Jpipe.required "state" Jdec.int + |> Jpipe.required "total_cpu_time" Jdec.int + +encodeMsgProfilingThreadInfo : MsgProfilingThreadInfo -> Jenc.Value +encodeMsgProfilingThreadInfo x = + Jenc.object + [ ("age", Jenc.int x.age) + , ("name", Jenc.string x.name) + , ("stack_size", Jenc.int x.stackSize) + , ("stack_usage", Jenc.int x.stackUsage) + , ("state", Jenc.int x.state) + , ("total_cpu_time", Jenc.int x.totalCPUTime) + ] + msgProtectionLevel : Jdec.Decoder MsgProtectionLevel msgProtectionLevel = Jpipe.decode MsgProtectionLevel diff --git a/sbpjson/javascript/SbpJson.js b/sbpjson/javascript/SbpJson.js index fd15b5f96..cefc2733a 100644 --- a/sbpjson/javascript/SbpJson.js +++ b/sbpjson/javascript/SbpJson.js @@ -127,6 +127,9 @@ // const msgPosLLHGnss = Convert.toMsgPosLLHGnss(json); // const msgPoseRelative = Convert.toMsgPoseRelative(json); // const msgPpsTime = Convert.toMsgPpsTime(json); +// const msgProfilingResourceCounter = Convert.toMsgProfilingResourceCounter(json); +// const msgProfilingSystemInfo = Convert.toMsgProfilingSystemInfo(json); +// const msgProfilingThreadInfo = Convert.toMsgProfilingThreadInfo(json); // const msgProtectionLevel = Convert.toMsgProtectionLevel(json); // const msgReferenceFrameParam = Convert.toMsgReferenceFrameParam(json); // const msgReset = Convert.toMsgReset(json); @@ -200,6 +203,7 @@ // const packedOsrContent = Convert.toPackedOsrContent(json); // const period = Convert.toPeriod(json); // const phaseBiasesContent = Convert.toPhaseBiasesContent(json); +// const resourceBucket = Convert.toResourceBucket(json); // const sTECHeader = Convert.toSTECHeader(json); // const sTECResidual = Convert.toSTECResidual(json); // const sTECResidualNoStd = Convert.toSTECResidualNoStd(json); @@ -1224,6 +1228,30 @@ function msgPpsTimeToJson(value) { return JSON.stringify(uncast(value, r("MsgPpsTime")), null, 2); } +function toMsgProfilingResourceCounter(json) { + return cast(JSON.parse(json), r("MsgProfilingResourceCounter")); +} + +function msgProfilingResourceCounterToJson(value) { + return JSON.stringify(uncast(value, r("MsgProfilingResourceCounter")), null, 2); +} + +function toMsgProfilingSystemInfo(json) { + return cast(JSON.parse(json), r("MsgProfilingSystemInfo")); +} + +function msgProfilingSystemInfoToJson(value) { + return JSON.stringify(uncast(value, r("MsgProfilingSystemInfo")), null, 2); +} + +function toMsgProfilingThreadInfo(json) { + return cast(JSON.parse(json), r("MsgProfilingThreadInfo")); +} + +function msgProfilingThreadInfoToJson(value) { + return JSON.stringify(uncast(value, r("MsgProfilingThreadInfo")), null, 2); +} + function toMsgProtectionLevel(json) { return cast(JSON.parse(json), r("MsgProtectionLevel")); } @@ -1808,6 +1836,14 @@ function phaseBiasesContentToJson(value) { return JSON.stringify(uncast(value, r("PhaseBiasesContent")), null, 2); } +function toResourceBucket(json) { + return cast(JSON.parse(json), r("ResourceBucket")); +} + +function resourceBucketToJson(value) { + return JSON.stringify(uncast(value, r("ResourceBucket")), null, 2); +} + function toSTECHeader(json) { return cast(JSON.parse(json), r("STECHeader")); } @@ -3002,6 +3038,36 @@ const typeMap = { { json: "flags", js: "flags", typ: 0 }, { json: "time", js: "time", typ: 0 }, ], "any"), + "MsgProfilingResourceCounter": o([ + { json: "buckets", js: "buckets", typ: a(r("ResourceBucket")) }, + { json: "seq_len", js: "seq_len", typ: 0 }, + { json: "seq_no", js: "seq_no", typ: 0 }, + ], "any"), + "ResourceBucket": o([ + { json: "cv", js: "cv", typ: 0 }, + { json: "heap_bytes_alloc", js: "heap_bytes_alloc", typ: 0 }, + { json: "heap_bytes_free", js: "heap_bytes_free", typ: 0 }, + { json: "io", js: "io", typ: 0 }, + { json: "io_read", js: "io_read", typ: 0 }, + { json: "io_write", js: "io_write", typ: 0 }, + { json: "mutex", js: "mutex", typ: 0 }, + { json: "name", js: "name", typ: "" }, + { json: "thread", js: "thread", typ: 0 }, + ], "any"), + "MsgProfilingSystemInfo": o([ + { json: "age", js: "age", typ: 0 }, + { json: "heap_usage", js: "heap_usage", typ: 0 }, + { json: "n_threads", js: "n_threads", typ: 0 }, + { json: "total_cpu_time", js: "total_cpu_time", typ: 0 }, + ], "any"), + "MsgProfilingThreadInfo": o([ + { json: "age", js: "age", typ: 0 }, + { json: "name", js: "name", typ: "" }, + { json: "stack_size", js: "stack_size", typ: 0 }, + { json: "stack_usage", js: "stack_usage", typ: 0 }, + { json: "state", js: "state", typ: 0 }, + { json: "total_cpu_time", js: "total_cpu_time", typ: 0 }, + ], "any"), "MsgProtectionLevel": o([ { json: "atpl", js: "atpl", typ: 0 }, { json: "ctpl", js: "ctpl", typ: 0 }, @@ -3886,6 +3952,12 @@ module.exports = { "toMsgPoseRelative": toMsgPoseRelative, "msgPpsTimeToJson": msgPpsTimeToJson, "toMsgPpsTime": toMsgPpsTime, + "msgProfilingResourceCounterToJson": msgProfilingResourceCounterToJson, + "toMsgProfilingResourceCounter": toMsgProfilingResourceCounter, + "msgProfilingSystemInfoToJson": msgProfilingSystemInfoToJson, + "toMsgProfilingSystemInfo": toMsgProfilingSystemInfo, + "msgProfilingThreadInfoToJson": msgProfilingThreadInfoToJson, + "toMsgProfilingThreadInfo": toMsgProfilingThreadInfo, "msgProtectionLevelToJson": msgProtectionLevelToJson, "toMsgProtectionLevel": toMsgProtectionLevel, "msgReferenceFrameParamToJson": msgReferenceFrameParamToJson, @@ -4032,6 +4104,8 @@ module.exports = { "toPeriod": toPeriod, "phaseBiasesContentToJson": phaseBiasesContentToJson, "toPhaseBiasesContent": toPhaseBiasesContent, + "resourceBucketToJson": resourceBucketToJson, + "toResourceBucket": toResourceBucket, "sTECHeaderToJson": sTECHeaderToJson, "toSTECHeader": toSTECHeader, "sTECResidualToJson": sTECResidualToJson, diff --git a/sbpjson/typescript/SbpJson.ts b/sbpjson/typescript/SbpJson.ts index fb17ed827..5c0690f5e 100644 --- a/sbpjson/typescript/SbpJson.ts +++ b/sbpjson/typescript/SbpJson.ts @@ -1,6 +1,6 @@ // To parse this data: // -// import { Convert, AcqSvProfile, AlmanacCommonContent, BoundsHeader, CarrierPhase, CodeBiasesContent, CodePhaseBiasesSatSig, Doppler, ECDSASignature, EphemerisCommonContent, EstimatedHorizontalErrorEllipse, GNSSInputType, GnssCapb, GnssSignal, GpsTime, GpsTimeSEC, GridElement, GridElementNoStd, GriddedCorrectionHeader, IMUInputType, IntegritySSRHeader, Latency, MeasurementState, MsgAcknowledge, MsgAcqResult, MsgAcqSvProfile, MsgAgeCorrections, MsgAlmanacGPS, MsgAlmanacGlo, MsgAngularRate, MsgBasePosECEF, MsgBasePosLLH, MsgBaselineECEF, MsgBaselineHeading, MsgBaselineNED, MsgBootloaderHandshakeResp, MsgBootloaderJumpToApp, MsgCellModemStatus, MsgCertificateChain, MsgCommandOutput, MsgCommandReq, MsgCommandResp, MsgCsacTelemetry, MsgCsacTelemetryLabels, MsgDeviceMonitor, MsgDgnssStatus, MsgDops, MsgEcdsaCertificate, MsgEcdsaSignature, MsgEphemerisBds, MsgEphemerisGPS, MsgEphemerisGal, MsgEphemerisGlo, MsgEphemerisQzss, MsgEphemerisSbas, MsgEXTEvent, MsgFileioConfigReq, MsgFileioConfigResp, MsgFileioReadDirReq, MsgFileioReadDirResp, MsgFileioReadReq, MsgFileioReadResp, MsgFileioRemove, MsgFileioWriteReq, MsgFileioWriteResp, MsgFlashDone, MsgFlashErase, MsgFlashProgram, MsgFlashReadReq, MsgFlashReadResp, MsgFrontEndGain, MsgFwd, MsgGPSTime, MsgGPSTimeGnss, MsgGloBiases, MsgGnssCapb, MsgGnssTimeOffset, MsgGroupDelay, MsgGroupMeta, MsgHeartbeat, MsgIarState, MsgImuAux, MsgImuRaw, MsgInsStatus, MsgInsUpdates, MsgIono, MsgLinuxCPUState, MsgLinuxMemState, MsgLinuxProcessFdCount, MsgLinuxProcessFdSummary, MsgLinuxProcessSocketCounts, MsgLinuxProcessSocketQueues, MsgLinuxSocketUsage, MsgLinuxSysState, MsgLog, MsgM25FlashWriteStatus, MsgMagRaw, MsgMaskSatellite, MsgMeasurementPoint, MsgMeasurementState, MsgNapDeviceDnaResp, MsgNdbEvent, MsgNetworkBandwidthUsage, MsgNetworkStateResp, MsgObs, MsgOdometry, MsgOrientEuler, MsgOrientQuat, MsgOsr, MsgPosECEF, MsgPosECEFCov, MsgPosECEFCovGnss, MsgPosECEFGnss, MsgPosLLH, MsgPosLLHAcc, MsgPosLLHCov, MsgPosLLHCovGnss, MsgPosLLHGnss, MsgPoseRelative, MsgPpsTime, MsgProtectionLevel, MsgReferenceFrameParam, MsgReset, MsgResetFilters, MsgSbasRaw, MsgSensorAidEvent, MsgSettingsReadByIndexReq, MsgSettingsReadByIndexResp, MsgSettingsReadReq, MsgSettingsReadResp, MsgSettingsRegister, MsgSettingsRegisterResp, MsgSettingsWrite, MsgSettingsWriteResp, MsgSolnMeta, MsgSpecan, MsgSsrCodeBiases, MsgSsrCodePhaseBiasesBounds, MsgSsrFlagHighLevel, MsgSsrFlagIonoGridPointSatLos, MsgSsrFlagIonoGridPoints, MsgSsrFlagIonoTileSatLos, MsgSsrFlagSatellites, MsgSsrFlagTropoGridPoints, MsgSsrGriddedCorrection, MsgSsrGriddedCorrectionBounds, MsgSsrOrbitClock, MsgSsrOrbitClockBounds, MsgSsrOrbitClockBoundsDegradation, MsgSsrPhaseBiases, MsgSsrSatelliteApc, MsgSsrStecCorrection, MsgSsrTileDefinition, MsgStartup, MsgStatusJournal, MsgStatusReport, MsgStmFlashLockSector, MsgStmFlashUnlockSector, MsgStmUniqueIDResp, MsgSvAzEl, MsgTelSv, MsgThreadState, MsgTrackingIq, MsgTrackingState, MsgUARTState, MsgUserData, MsgUTCLeapSecond, MsgUTCTime, MsgUTCTimeGnss, MsgVelBody, MsgVelCog, MsgVelECEF, MsgVelECEFCov, MsgVelECEFCovGnss, MsgVelECEFGnss, MsgVelNED, MsgVelNEDCov, MsgVelNEDCovGnss, MsgVelNEDGnss, MsgWheeltick, NetworkUsage, ObservationHeader, OdoInputType, OrbitClockBound, OrbitClockBoundDegradation, PackedObsContent, PackedOsrContent, Period, PhaseBiasesContent, STECHeader, STECResidual, STECResidualNoStd, STECSatElement, STECSatElementIntegrity, SatelliteAPC, SolutionInputType, StatusJournalItem, SubSystemReport, SvAzEl, SvID, TelemetrySV, TrackingChannelCorrelation, TrackingChannelState, TroposphericDelayCorrection, TroposphericDelayCorrectionNoStd, UARTChannel, UTCTime } from "./file"; +// import { Convert, AcqSvProfile, AlmanacCommonContent, BoundsHeader, CarrierPhase, CodeBiasesContent, CodePhaseBiasesSatSig, Doppler, ECDSASignature, EphemerisCommonContent, EstimatedHorizontalErrorEllipse, GNSSInputType, GnssCapb, GnssSignal, GpsTime, GpsTimeSEC, GridElement, GridElementNoStd, GriddedCorrectionHeader, IMUInputType, IntegritySSRHeader, Latency, MeasurementState, MsgAcknowledge, MsgAcqResult, MsgAcqSvProfile, MsgAgeCorrections, MsgAlmanacGPS, MsgAlmanacGlo, MsgAngularRate, MsgBasePosECEF, MsgBasePosLLH, MsgBaselineECEF, MsgBaselineHeading, MsgBaselineNED, MsgBootloaderHandshakeResp, MsgBootloaderJumpToApp, MsgCellModemStatus, MsgCertificateChain, MsgCommandOutput, MsgCommandReq, MsgCommandResp, MsgCsacTelemetry, MsgCsacTelemetryLabels, MsgDeviceMonitor, MsgDgnssStatus, MsgDops, MsgEcdsaCertificate, MsgEcdsaSignature, MsgEphemerisBds, MsgEphemerisGPS, MsgEphemerisGal, MsgEphemerisGlo, MsgEphemerisQzss, MsgEphemerisSbas, MsgEXTEvent, MsgFileioConfigReq, MsgFileioConfigResp, MsgFileioReadDirReq, MsgFileioReadDirResp, MsgFileioReadReq, MsgFileioReadResp, MsgFileioRemove, MsgFileioWriteReq, MsgFileioWriteResp, MsgFlashDone, MsgFlashErase, MsgFlashProgram, MsgFlashReadReq, MsgFlashReadResp, MsgFrontEndGain, MsgFwd, MsgGPSTime, MsgGPSTimeGnss, MsgGloBiases, MsgGnssCapb, MsgGnssTimeOffset, MsgGroupDelay, MsgGroupMeta, MsgHeartbeat, MsgIarState, MsgImuAux, MsgImuRaw, MsgInsStatus, MsgInsUpdates, MsgIono, MsgLinuxCPUState, MsgLinuxMemState, MsgLinuxProcessFdCount, MsgLinuxProcessFdSummary, MsgLinuxProcessSocketCounts, MsgLinuxProcessSocketQueues, MsgLinuxSocketUsage, MsgLinuxSysState, MsgLog, MsgM25FlashWriteStatus, MsgMagRaw, MsgMaskSatellite, MsgMeasurementPoint, MsgMeasurementState, MsgNapDeviceDnaResp, MsgNdbEvent, MsgNetworkBandwidthUsage, MsgNetworkStateResp, MsgObs, MsgOdometry, MsgOrientEuler, MsgOrientQuat, MsgOsr, MsgPosECEF, MsgPosECEFCov, MsgPosECEFCovGnss, MsgPosECEFGnss, MsgPosLLH, MsgPosLLHAcc, MsgPosLLHCov, MsgPosLLHCovGnss, MsgPosLLHGnss, MsgPoseRelative, MsgPpsTime, MsgProfilingResourceCounter, MsgProfilingSystemInfo, MsgProfilingThreadInfo, MsgProtectionLevel, MsgReferenceFrameParam, MsgReset, MsgResetFilters, MsgSbasRaw, MsgSensorAidEvent, MsgSettingsReadByIndexReq, MsgSettingsReadByIndexResp, MsgSettingsReadReq, MsgSettingsReadResp, MsgSettingsRegister, MsgSettingsRegisterResp, MsgSettingsWrite, MsgSettingsWriteResp, MsgSolnMeta, MsgSpecan, MsgSsrCodeBiases, MsgSsrCodePhaseBiasesBounds, MsgSsrFlagHighLevel, MsgSsrFlagIonoGridPointSatLos, MsgSsrFlagIonoGridPoints, MsgSsrFlagIonoTileSatLos, MsgSsrFlagSatellites, MsgSsrFlagTropoGridPoints, MsgSsrGriddedCorrection, MsgSsrGriddedCorrectionBounds, MsgSsrOrbitClock, MsgSsrOrbitClockBounds, MsgSsrOrbitClockBoundsDegradation, MsgSsrPhaseBiases, MsgSsrSatelliteApc, MsgSsrStecCorrection, MsgSsrTileDefinition, MsgStartup, MsgStatusJournal, MsgStatusReport, MsgStmFlashLockSector, MsgStmFlashUnlockSector, MsgStmUniqueIDResp, MsgSvAzEl, MsgTelSv, MsgThreadState, MsgTrackingIq, MsgTrackingState, MsgUARTState, MsgUserData, MsgUTCLeapSecond, MsgUTCTime, MsgUTCTimeGnss, MsgVelBody, MsgVelCog, MsgVelECEF, MsgVelECEFCov, MsgVelECEFCovGnss, MsgVelECEFGnss, MsgVelNED, MsgVelNEDCov, MsgVelNEDCovGnss, MsgVelNEDGnss, MsgWheeltick, NetworkUsage, ObservationHeader, OdoInputType, OrbitClockBound, OrbitClockBoundDegradation, PackedObsContent, PackedOsrContent, Period, PhaseBiasesContent, ResourceBucket, STECHeader, STECResidual, STECResidualNoStd, STECSatElement, STECSatElementIntegrity, SatelliteAPC, SolutionInputType, StatusJournalItem, SubSystemReport, SvAzEl, SvID, TelemetrySV, TrackingChannelCorrelation, TrackingChannelState, TroposphericDelayCorrection, TroposphericDelayCorrectionNoStd, UARTChannel, UTCTime } from "./file"; // // const acqSvProfile = Convert.toAcqSvProfile(json); // const almanacCommonContent = Convert.toAlmanacCommonContent(json); @@ -127,6 +127,9 @@ // const msgPosLLHGnss = Convert.toMsgPosLLHGnss(json); // const msgPoseRelative = Convert.toMsgPoseRelative(json); // const msgPpsTime = Convert.toMsgPpsTime(json); +// const msgProfilingResourceCounter = Convert.toMsgProfilingResourceCounter(json); +// const msgProfilingSystemInfo = Convert.toMsgProfilingSystemInfo(json); +// const msgProfilingThreadInfo = Convert.toMsgProfilingThreadInfo(json); // const msgProtectionLevel = Convert.toMsgProtectionLevel(json); // const msgReferenceFrameParam = Convert.toMsgReferenceFrameParam(json); // const msgReset = Convert.toMsgReset(json); @@ -200,6 +203,7 @@ // const packedOsrContent = Convert.toPackedOsrContent(json); // const period = Convert.toPeriod(json); // const phaseBiasesContent = Convert.toPhaseBiasesContent(json); +// const resourceBucket = Convert.toResourceBucket(json); // const sTECHeader = Convert.toSTECHeader(json); // const sTECResidual = Convert.toSTECResidual(json); // const sTECResidualNoStd = Convert.toSTECResidualNoStd(json); @@ -2026,6 +2030,62 @@ export interface MsgPpsTime { [property: string]: any; } +/** + * Information about resource buckets. Refer to product documentation to understand the + * meaning and values in this message. + */ +export interface MsgProfilingResourceCounter { + buckets: ResourceBucket[]; + seq_len: number; + seq_no: number; + [property: string]: any; +} + +/** + * Information about allocation of various resources grouped by buckets. Refer to product + * documentation to understand the meaning and values in this message. + */ +export interface ResourceBucket { + cv: number; + heap_bytes_alloc: number; + heap_bytes_free: number; + io: number; + io_read: number; + io_write: number; + mutex: number; + name: string; + thread: number; + [property: string]: any; +} + +/** + * Contains basic information about system resource usage. System is defined in terms of the + * source of this message and may vary from sender to sender. Refer to product + * documentation to understand the exact scope and meaning of this message. + */ +export interface MsgProfilingSystemInfo { + age: number; + heap_usage: number; + n_threads: number; + total_cpu_time: number; + [property: string]: any; +} + +/** + * Contains profiling information related to a single thread being tracked by the producing + * system. Refer to product documentation to understand the exact scope and meaning of this + * message. + */ +export interface MsgProfilingThreadInfo { + age: number; + name: string; + stack_size: number; + stack_usage: number; + state: number; + total_cpu_time: number; + [property: string]: any; +} + /** * This message reports the protection levels associated to the given state estimate. The * full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). @@ -4245,6 +4305,30 @@ export class Convert { return JSON.stringify(uncast(value, r("MsgPpsTime")), null, 2); } + public static toMsgProfilingResourceCounter(json: string): MsgProfilingResourceCounter { + return cast(JSON.parse(json), r("MsgProfilingResourceCounter")); + } + + public static msgProfilingResourceCounterToJson(value: MsgProfilingResourceCounter): string { + return JSON.stringify(uncast(value, r("MsgProfilingResourceCounter")), null, 2); + } + + public static toMsgProfilingSystemInfo(json: string): MsgProfilingSystemInfo { + return cast(JSON.parse(json), r("MsgProfilingSystemInfo")); + } + + public static msgProfilingSystemInfoToJson(value: MsgProfilingSystemInfo): string { + return JSON.stringify(uncast(value, r("MsgProfilingSystemInfo")), null, 2); + } + + public static toMsgProfilingThreadInfo(json: string): MsgProfilingThreadInfo { + return cast(JSON.parse(json), r("MsgProfilingThreadInfo")); + } + + public static msgProfilingThreadInfoToJson(value: MsgProfilingThreadInfo): string { + return JSON.stringify(uncast(value, r("MsgProfilingThreadInfo")), null, 2); + } + public static toMsgProtectionLevel(json: string): MsgProtectionLevel { return cast(JSON.parse(json), r("MsgProtectionLevel")); } @@ -4829,6 +4913,14 @@ export class Convert { return JSON.stringify(uncast(value, r("PhaseBiasesContent")), null, 2); } + public static toResourceBucket(json: string): ResourceBucket { + return cast(JSON.parse(json), r("ResourceBucket")); + } + + public static resourceBucketToJson(value: ResourceBucket): string { + return JSON.stringify(uncast(value, r("ResourceBucket")), null, 2); + } + public static toSTECHeader(json: string): STECHeader { return cast(JSON.parse(json), r("STECHeader")); } @@ -6024,6 +6116,36 @@ const typeMap: any = { { json: "flags", js: "flags", typ: 0 }, { json: "time", js: "time", typ: 0 }, ], "any"), + "MsgProfilingResourceCounter": o([ + { json: "buckets", js: "buckets", typ: a(r("ResourceBucket")) }, + { json: "seq_len", js: "seq_len", typ: 0 }, + { json: "seq_no", js: "seq_no", typ: 0 }, + ], "any"), + "ResourceBucket": o([ + { json: "cv", js: "cv", typ: 0 }, + { json: "heap_bytes_alloc", js: "heap_bytes_alloc", typ: 0 }, + { json: "heap_bytes_free", js: "heap_bytes_free", typ: 0 }, + { json: "io", js: "io", typ: 0 }, + { json: "io_read", js: "io_read", typ: 0 }, + { json: "io_write", js: "io_write", typ: 0 }, + { json: "mutex", js: "mutex", typ: 0 }, + { json: "name", js: "name", typ: "" }, + { json: "thread", js: "thread", typ: 0 }, + ], "any"), + "MsgProfilingSystemInfo": o([ + { json: "age", js: "age", typ: 0 }, + { json: "heap_usage", js: "heap_usage", typ: 0 }, + { json: "n_threads", js: "n_threads", typ: 0 }, + { json: "total_cpu_time", js: "total_cpu_time", typ: 0 }, + ], "any"), + "MsgProfilingThreadInfo": o([ + { json: "age", js: "age", typ: 0 }, + { json: "name", js: "name", typ: "" }, + { json: "stack_size", js: "stack_size", typ: 0 }, + { json: "stack_usage", js: "stack_usage", typ: 0 }, + { json: "state", js: "state", typ: 0 }, + { json: "total_cpu_time", js: "total_cpu_time", typ: 0 }, + ], "any"), "MsgProtectionLevel": o([ { json: "atpl", js: "atpl", typ: 0 }, { json: "ctpl", js: "ctpl", typ: 0 },