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 0000000000..21a438bcf6 --- /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 0000000000..ea69c129a5 --- /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 0000000000..89ca33b4a8 Binary files /dev/null and b/java/test/auto_check_sbp_profiling_MsgProfilingThreadInfoTest.java differ diff --git a/jsonschema/MsgProfilingResourceCounter.json b/jsonschema/MsgProfilingResourceCounter.json new file mode 100644 index 0000000000..fd091e4191 --- /dev/null +++ b/jsonschema/MsgProfilingResourceCounter.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "Copyright (C) 2019-2021 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." + ], + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "#MsgProfilingResourceCounter", + "title":"MsgProfilingResourceCounter", + "description":"Information about resource buckets. Refer to product documentation to understand the meaning and values in this message.\n", + "type": "object", + "properties": { + "seq_no": {"type": "integer"}, + "seq_len": {"type": "integer"}, + "buckets": {"type": "array", "items": {"$ref": "ResourceBucket.json"}} + }, + "required": [ + "seq_no", + "seq_len", + "buckets" + ] +} \ No newline at end of file diff --git a/jsonschema/MsgProfilingSystemInfo.json b/jsonschema/MsgProfilingSystemInfo.json new file mode 100644 index 0000000000..2a9ba9a56a --- /dev/null +++ b/jsonschema/MsgProfilingSystemInfo.json @@ -0,0 +1,30 @@ +{ + "copyright": [ + "Copyright (C) 2019-2021 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." + ], + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "#MsgProfilingSystemInfo", + "title":"MsgProfilingSystemInfo", + "description":"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.\n", + "type": "object", + "properties": { + "total_cpu_time": {"type": "integer"}, + "age": {"type": "integer"}, + "n_threads": {"type": "integer"}, + "heap_usage": {"type": "integer"} + }, + "required": [ + "total_cpu_time", + "age", + "n_threads", + "heap_usage" + ] +} \ No newline at end of file diff --git a/jsonschema/MsgProfilingThreadInfo.json b/jsonschema/MsgProfilingThreadInfo.json new file mode 100644 index 0000000000..0eced825e4 --- /dev/null +++ b/jsonschema/MsgProfilingThreadInfo.json @@ -0,0 +1,34 @@ +{ + "copyright": [ + "Copyright (C) 2019-2021 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." + ], + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "#MsgProfilingThreadInfo", + "title":"MsgProfilingThreadInfo", + "description":"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.\n", + "type": "object", + "properties": { + "total_cpu_time": {"type": "integer"}, + "age": {"type": "integer"}, + "state": {"type": "integer"}, + "stack_size": {"type": "integer"}, + "stack_usage": {"type": "integer"}, + "name": {"type": "string"} + }, + "required": [ + "total_cpu_time", + "age", + "state", + "stack_size", + "stack_usage", + "name" + ] +} \ No newline at end of file diff --git a/jsonschema/ResourceBucket.json b/jsonschema/ResourceBucket.json new file mode 100644 index 0000000000..40c51a3570 --- /dev/null +++ b/jsonschema/ResourceBucket.json @@ -0,0 +1,40 @@ +{ + "copyright": [ + "Copyright (C) 2019-2021 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." + ], + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "#ResourceBucket", + "title":"ResourceBucket", + "description":"Information about allocation of various resources grouped by buckets. Refer to product documentation to understand the meaning and values in this message.\n", + "type": "object", + "properties": { + "name": {"type": "string"}, + "thread": {"type": "integer"}, + "mutex": {"type": "integer"}, + "cv": {"type": "integer"}, + "io": {"type": "integer"}, + "heap_bytes_alloc": {"type": "integer"}, + "heap_bytes_free": {"type": "integer"}, + "io_write": {"type": "integer"}, + "io_read": {"type": "integer"} + }, + "required": [ + "name", + "thread", + "mutex", + "cv", + "io", + "heap_bytes_alloc", + "heap_bytes_free", + "io_write", + "io_read" + ] +} \ No newline at end of file diff --git a/sbpjson/elm/SbpJson.elm b/sbpjson/elm/SbpJson.elm index db6b665b0b..b0de21236d 100644 --- a/sbpjson/elm/SbpJson.elm +++ b/sbpjson/elm/SbpJson.elm @@ -5,7 +5,7 @@ -- add these imports -- -- import Json.Decode exposing (decodeString)`); --- import SbpJson exposing (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, msgAlmanac, msgAlmanacGPS, msgAlmanacGlo, msgAngularRate, msgBasePosECEF, msgBasePosLLH, msgBaselineECEF, msgBaselineHeading, msgBaselineNED, msgBootloaderHandshakeReq, msgBootloaderHandshakeResp, msgBootloaderJumpToApp, msgCellModemStatus, msgCertificateChain, msgCommandOutput, msgCommandReq, msgCommandResp, msgCsacTelemetry, msgCsacTelemetryLabels, msgCwResults, msgCwStart, 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, msgNapDeviceDnaReq, msgNapDeviceDnaResp, msgNdbEvent, msgNetworkBandwidthUsage, msgNetworkStateReq, msgNetworkStateResp, msgObs, msgOdometry, msgOrientEuler, msgOrientQuat, msgOsr, msgPosECEF, msgPosECEFCov, msgPosECEFCovGnss, msgPosECEFGnss, msgPosLLH, msgPosLLHAcc, msgPosLLHCov, msgPosLLHCovGnss, msgPosLLHGnss, msgPoseRelative, msgPpsTime, msgProtectionLevel, msgReferenceFrameParam, msgReset, msgResetFilters, msgSbasRaw, msgSensorAidEvent, msgSetTime, msgSettingsReadByIndexDone, msgSettingsReadByIndexReq, msgSettingsReadByIndexResp, msgSettingsReadReq, msgSettingsReadResp, msgSettingsRegister, msgSettingsRegisterResp, msgSettingsSave, 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, msgStmUniqueIDReq, 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) +-- import SbpJson exposing (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, msgAlmanac, msgAlmanacGPS, msgAlmanacGlo, msgAngularRate, msgBasePosECEF, msgBasePosLLH, msgBaselineECEF, msgBaselineHeading, msgBaselineNED, msgBootloaderHandshakeReq, msgBootloaderHandshakeResp, msgBootloaderJumpToApp, msgCellModemStatus, msgCertificateChain, msgCommandOutput, msgCommandReq, msgCommandResp, msgCsacTelemetry, msgCsacTelemetryLabels, msgCwResults, msgCwStart, 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, msgNapDeviceDnaReq, msgNapDeviceDnaResp, msgNdbEvent, msgNetworkBandwidthUsage, msgNetworkStateReq, 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, msgSetTime, msgSettingsReadByIndexDone, msgSettingsReadByIndexReq, msgSettingsReadByIndexResp, msgSettingsReadReq, msgSettingsReadResp, msgSettingsRegister, msgSettingsRegisterResp, msgSettingsSave, 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, msgStmUniqueIDReq, 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) -- -- and you're off to the races with -- @@ -134,6 +134,9 @@ -- decodeString msgPosLLHGnss myJsonString -- decodeString msgPoseRelative myJsonString -- decodeString msgPpsTime myJsonString +-- decodeString msgProfilingResourceCounter myJsonString +-- decodeString msgProfilingSystemInfo myJsonString +-- decodeString msgProfilingThreadInfo myJsonString -- decodeString msgProtectionLevel myJsonString -- decodeString msgReferenceFrameParam myJsonString -- decodeString msgReset myJsonString @@ -207,6 +210,7 @@ -- decodeString packedOsrContent myJsonString -- decodeString period myJsonString -- decodeString phaseBiasesContent myJsonString +-- decodeString resourceBucket myJsonString -- decodeString stecHeader myJsonString -- decodeString stecResidual myJsonString -- decodeString stecResidualNoStd myJsonString @@ -602,6 +606,15 @@ module SbpJson exposing , MsgPpsTime , msgPpsTimeToString , msgPpsTime + , MsgProfilingResourceCounter + , msgProfilingResourceCounterToString + , msgProfilingResourceCounter + , MsgProfilingSystemInfo + , msgProfilingSystemInfoToString + , msgProfilingSystemInfo + , MsgProfilingThreadInfo + , msgProfilingThreadInfoToString + , msgProfilingThreadInfo , MsgProtectionLevel , msgProtectionLevelToString , msgProtectionLevel @@ -821,6 +834,9 @@ module SbpJson exposing , PhaseBiasesContent , phaseBiasesContentToString , phaseBiasesContent + , ResourceBucket + , resourceBucketToString + , resourceBucket , STECHeader , stecHeaderToString , stecHeader @@ -2448,6 +2464,54 @@ type alias MsgPpsTime = , time : Int } +{-| Information about resource buckets. Refer to product documentation to understand the +meaning and values in this message. +-} +type alias MsgProfilingResourceCounter = + { buckets : Array ResourceBucket + , seqLen : Int + , seqNo : Int + } + +{-| Information about allocation of various resources grouped by buckets. Refer to product +documentation to understand the meaning and values in this message. +-} +type alias ResourceBucket = + { cv : Int + , heapBytesAlloc : Int + , heapBytesFree : Int + , io : Int + , ioRead : Int + , ioWrite : Int + , mutex : Int + , name : String + , thread : Int + } + +{-| 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. +-} +type alias MsgProfilingSystemInfo = + { age : Int + , heapUsage : Int + , nThreads : Int + , totalCPUTime : Int + } + +{-| 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. +-} +type alias MsgProfilingThreadInfo = + { age : Int + , name : String + , stackSize : Int + , stackUsage : Int + , state : Int + , totalCPUTime : Int + } + {-| 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). -} @@ -3895,6 +3959,15 @@ msgPoseRelativeToString r = Jenc.encode 0 (encodeMsgPoseRelative r) msgPpsTimeToString : MsgPpsTime -> 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 fd15b5f96b..cefc2733a2 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 fb17ed827d..5c0690f5ea 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 },