From de972769446e6356729ea5b1cba76f27350539d1 Mon Sep 17 00:00:00 2001 From: akvlad Date: Wed, 15 Nov 2023 18:39:43 +0200 Subject: [PATCH 01/18] schema init --- lib/db/maintain/index.js | 2 + lib/db/maintain/scripts.js | 129 +++++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) diff --git a/lib/db/maintain/index.js b/lib/db/maintain/index.js index f1689154..718980a2 100644 --- a/lib/db/maintain/index.js +++ b/lib/db/maintain/index.js @@ -21,9 +21,11 @@ module.exports.upgrade = async (db) => { const scripts = require('./scripts') await upgradeSingle(db, 1, scripts.overall) await upgradeSingle(db, 2, scripts.traces) + await upgradeSingle(db, 5, scripts.profiles) if (clusterName) { await upgradeSingle(db, 3, scripts.overall_dist) await upgradeSingle(db, 4, scripts.traces_dist) + await upgradeSingle(db, 6, scripts.profiles_dist) } } diff --git a/lib/db/maintain/scripts.js b/lib/db/maintain/scripts.js index 6376e36b..6d181e74 100644 --- a/lib/db/maintain/scripts.js +++ b/lib/db/maintain/scripts.js @@ -230,3 +230,132 @@ module.exports.traces_dist = [ duration Int64 ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}', 'tempo_traces_attrs_gin', sipHash64(oid, trace_id));` ] + +module.exports.profiles = [ + `CREATE TABLE IF NOT EXISTS profiles_input {{{OnCluster}}} ( + timestamp_ns UInt64, + profile_id FixedString(16), + type LowCardinality(String), + sample_type LowCardinality(String), + sample_unit LowCardinality(String), + period_type LowCardinality(String), + period_unit LowCardinality(String), + tags Array(Tuple(String, String)), + duration_ns UInt64, + value UInt64, + payload_type LowCardinality(String), + payload String + ) Engine=Null`, + + `CREATE TABLE IF NOT EXISTS profiles {{{OnCluster}}} ( + timestamp_ns UInt64 CODEC(DoubleDelta, ZSTD(1)), + fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), + type_id LowCardinality(String) CODEC(ZSTD(1)), + tags Array(Tuple(String, String)) CODEC(ZSTD(1)), + profile_id FixedString(16) CODEC(ZSTD(1)), + duration_ns UInt64 CODEC(DoubleDelta, ZSTD(1)), + value UInt64 CODEC(Delta, ZSTD(1)), + payload_type LowCardinality(String) CODEC(ZSTD(1)), + payload String CODEC(ZSTD(1)) + ) Engine {{MergeTree}}() + ORDER BY (timestamp_ns) + PARTITION BY toDate(FROM_UNIXTIME(intDiv(timestamp_ns, 1000000000)))`, + + `CREATE MATERIALIZED VIEW IF NOT EXISTS profiles_mv {{{OnCluster}}} TO profiles AS + SELECT + timestamp_ns, + cityHash64(arraySort(arrayConcat( + profiles_input.tags, [('__type__', concatWithSeparator(':', sample_type, sample_unit, period_type, period_unit) as _type_id)] + )) as _tags) as fingerprint, + _type_id as type_id, + _tags as tags, + unhex(profile_id)::FixedString(16) as profile_id, + duration_ns, + value, + payload_type, + payload + FROM profiles_input`, + + `CREATE TABLE IF NOT EXISTS profiles_series {{{OnCluster}}} ( + date Date, + fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), + tags Array(Tuple(String, String)) CODEC(ZSTD(1)), + ) Engine {{ReplacingMergeTree}}() + ORDER BY (date, fingerprint) + PARTITION BY date`, + + `CREATE MATERIALIZED VIEW IF NOT EXISTS profiles_series_mv {{{OnCluster}}} TO profiles_series AS + SELECT + toDate(intDiv(timestamp_ns, 1000000000)) as date, + fingerprint, + tags + FROM profiles`, + + `CREATE TABLE IF NOT EXISTS profiles_series_gin {{{OnCluster}}} ( + date Date, + key String, + val String, + fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), + ) Engine {{ReplacingMergeTree}}() + ORDER BY (date, key, val, fingerprint) + PARTITION BY date`, + + `CREATE MATERIALIZED VIEW IF NOT EXISTS profiles_series_gin_mv {{{OnCluster}}} TO profiles_series_gin AS + SELECT + date, + kv.1 as key, + kv.2 as val, + fingerprint, + FROM profiles_series ARRAY JOIN tags as kv`, + + `CREATE TABLE IF NOT EXISTS profiles_series_keys {{{OnCluster}}} ( + date Date, + key String, + val String, + val_id UInt64, + ) Engine {{ReplacingMergeTree}}() + ORDER BY (date, key, val_id) + PARTITION BY date`, + + `CREATE MATERIALIZED VIEW IF NOT EXISTS profiles_series_keys_mv {{{OnCluster}}} TO profiles_series_keys AS + SELECT + date, + key, + val, + cityHash64(val) % 50000 as val_id + FROM profiles_series_gin` +] + +module.exports.profiles_dist = [ + `CREATE TABLE IF NOT EXISTS profiles_dist {{{OnCluster}}} ( + timestamp_ns UInt64, + fingerprint UInt64, + type_id LowCardinality(String), + tags Array(Tuple(String, String)), + profile_id String, + duration_ns UInt64, + value UInt64, + payload_type LowCardinality(String), + payload String + ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles', fingerprint);`, + + `CREATE TABLE IF NOT EXISTS profiles_series {{{OnCluster}}} ( + date Date, + fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), + tags Array(Tuple(String, String)) CODEC(ZSTD(1)), + ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles',fingerprint);`, + + `CREATE TABLE IF NOT EXISTS profiles_series_gin {{{OnCluster}}} ( + date Date, + key String, + val String, + fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), + ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles',fingerprint);`, + + `CREATE TABLE IF NOT EXISTS profiles_series_keys {{{OnCluster}}} ( + date Date, + key String, + val String, + val_id UInt64, + ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles', rand());` +] From 210161e07ba279707f9e28a04e63eba66696bdc1 Mon Sep 17 00:00:00 2001 From: akvlad Date: Thu, 16 Nov 2023 16:21:19 +0200 Subject: [PATCH 02/18] upd: type_id, codecs --- lib/db/maintain/scripts.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/db/maintain/scripts.js b/lib/db/maintain/scripts.js index 6d181e74..02300669 100644 --- a/lib/db/maintain/scripts.js +++ b/lib/db/maintain/scripts.js @@ -258,7 +258,7 @@ module.exports.profiles = [ payload_type LowCardinality(String) CODEC(ZSTD(1)), payload String CODEC(ZSTD(1)) ) Engine {{MergeTree}}() - ORDER BY (timestamp_ns) + ORDER BY (type_id, timestamp_ns) PARTITION BY toDate(FROM_UNIXTIME(intDiv(timestamp_ns, 1000000000)))`, `CREATE MATERIALIZED VIEW IF NOT EXISTS profiles_mv {{{OnCluster}}} TO profiles AS @@ -277,27 +277,30 @@ module.exports.profiles = [ FROM profiles_input`, `CREATE TABLE IF NOT EXISTS profiles_series {{{OnCluster}}} ( - date Date, - fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), + date Date CODEC(ZSTD(1)), + type_id LowCardinality(String) CODEC(ZSTD(1)), + fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), tags Array(Tuple(String, String)) CODEC(ZSTD(1)), ) Engine {{ReplacingMergeTree}}() - ORDER BY (date, fingerprint) + ORDER BY (date, type_id, fingerprint) PARTITION BY date`, `CREATE MATERIALIZED VIEW IF NOT EXISTS profiles_series_mv {{{OnCluster}}} TO profiles_series AS SELECT toDate(intDiv(timestamp_ns, 1000000000)) as date, + type_id, fingerprint, tags FROM profiles`, `CREATE TABLE IF NOT EXISTS profiles_series_gin {{{OnCluster}}} ( - date Date, - key String, - val String, + date Date CODEC(ZSTD(1)), + key String CODEC(ZSTD(1)), + val String CODEC(ZSTD(1)), + type_id LowCardinality(String) CODEC(ZSTD(1)), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), ) Engine {{ReplacingMergeTree}}() - ORDER BY (date, key, val, fingerprint) + ORDER BY (date, key, val, type_id, fingerprint) PARTITION BY date`, `CREATE MATERIALIZED VIEW IF NOT EXISTS profiles_series_gin_mv {{{OnCluster}}} TO profiles_series_gin AS @@ -305,6 +308,7 @@ module.exports.profiles = [ date, kv.1 as key, kv.2 as val, + type_id, fingerprint, FROM profiles_series ARRAY JOIN tags as kv`, From f4c80739441278c8a506f8fd1eaa7d59dada10eb Mon Sep 17 00:00:00 2001 From: akvlad Date: Thu, 16 Nov 2023 17:00:56 +0200 Subject: [PATCH 03/18] fix: distributed tables --- lib/db/maintain/scripts.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/db/maintain/scripts.js b/lib/db/maintain/scripts.js index 02300669..5ad41cc4 100644 --- a/lib/db/maintain/scripts.js +++ b/lib/db/maintain/scripts.js @@ -345,21 +345,23 @@ module.exports.profiles_dist = [ `CREATE TABLE IF NOT EXISTS profiles_series {{{OnCluster}}} ( date Date, + type_id LowCardinality(String), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), tags Array(Tuple(String, String)) CODEC(ZSTD(1)), ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles',fingerprint);`, - `CREATE TABLE IF NOT EXISTS profiles_series_gin {{{OnCluster}}} ( + `CREATE TABLE IF NOT EXISTS profiles_series_gin_dist {{{OnCluster}}} ( date Date, key String, val String, + type_id LowCardinality(String), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), - ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles',fingerprint);`, + ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles_series_gin',fingerprint);`, - `CREATE TABLE IF NOT EXISTS profiles_series_keys {{{OnCluster}}} ( + `CREATE TABLE IF NOT EXISTS profiles_series_keys_dist {{{OnCluster}}} ( date Date, key String, val String, val_id UInt64, - ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles', rand());` + ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles_series_keys', rand());` ] From c73ae9c5d989d5c07b22df118f3fefe10b3695cd Mon Sep 17 00:00:00 2001 From: Tomer Shafir <86107951+tomershafir@users.noreply.github.com> Date: Sun, 10 Dec 2023 17:43:45 +0200 Subject: [PATCH 04/18] Update scripts.js Signed-off-by: Tomer Shafir <86107951+tomershafir@users.noreply.github.com> --- lib/db/maintain/scripts.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/db/maintain/scripts.js b/lib/db/maintain/scripts.js index 5ad41cc4..a08624f8 100644 --- a/lib/db/maintain/scripts.js +++ b/lib/db/maintain/scripts.js @@ -236,13 +236,11 @@ module.exports.profiles = [ timestamp_ns UInt64, profile_id FixedString(16), type LowCardinality(String), - sample_type LowCardinality(String), - sample_unit LowCardinality(String), + service_name LowCardinality(String), period_type LowCardinality(String), period_unit LowCardinality(String), tags Array(Tuple(String, String)), duration_ns UInt64, - value UInt64, payload_type LowCardinality(String), payload String ) Engine=Null`, @@ -251,23 +249,23 @@ module.exports.profiles = [ timestamp_ns UInt64 CODEC(DoubleDelta, ZSTD(1)), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), type_id LowCardinality(String) CODEC(ZSTD(1)), - tags Array(Tuple(String, String)) CODEC(ZSTD(1)), + service_name LowCardinality(String) CODEC(ZSTD(1)), profile_id FixedString(16) CODEC(ZSTD(1)), duration_ns UInt64 CODEC(DoubleDelta, ZSTD(1)), - value UInt64 CODEC(Delta, ZSTD(1)), payload_type LowCardinality(String) CODEC(ZSTD(1)), payload String CODEC(ZSTD(1)) ) Engine {{MergeTree}}() - ORDER BY (type_id, timestamp_ns) + ORDER BY (type_id, service_name, timestamp_ns) PARTITION BY toDate(FROM_UNIXTIME(intDiv(timestamp_ns, 1000000000)))`, `CREATE MATERIALIZED VIEW IF NOT EXISTS profiles_mv {{{OnCluster}}} TO profiles AS SELECT timestamp_ns, cityHash64(arraySort(arrayConcat( - profiles_input.tags, [('__type__', concatWithSeparator(':', sample_type, sample_unit, period_type, period_unit) as _type_id)] + profiles_input.tags, [('__type__', concatWithSeparator(':', type, period_type, period_unit) as _type_id), ('service_name', service_name)] )) as _tags) as fingerprint, _type_id as type_id, + service_name, _tags as tags, unhex(profile_id)::FixedString(16) as profile_id, duration_ns, @@ -279,6 +277,7 @@ module.exports.profiles = [ `CREATE TABLE IF NOT EXISTS profiles_series {{{OnCluster}}} ( date Date CODEC(ZSTD(1)), type_id LowCardinality(String) CODEC(ZSTD(1)), + service_name LowCardinality(String) CODEC(ZSTD(1)), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), tags Array(Tuple(String, String)) CODEC(ZSTD(1)), ) Engine {{ReplacingMergeTree}}() @@ -289,6 +288,7 @@ module.exports.profiles = [ SELECT toDate(intDiv(timestamp_ns, 1000000000)) as date, type_id, + service_name, fingerprint, tags FROM profiles`, @@ -298,6 +298,7 @@ module.exports.profiles = [ key String CODEC(ZSTD(1)), val String CODEC(ZSTD(1)), type_id LowCardinality(String) CODEC(ZSTD(1)), + service_name LowCardinality(String) CODEC(ZSTD(1)), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), ) Engine {{ReplacingMergeTree}}() ORDER BY (date, key, val, type_id, fingerprint) @@ -309,6 +310,7 @@ module.exports.profiles = [ kv.1 as key, kv.2 as val, type_id, + service_name, fingerprint, FROM profiles_series ARRAY JOIN tags as kv`, From d6bc8e1c49cfd616330b9bd6c15be0bd2f430f98 Mon Sep 17 00:00:00 2001 From: akvlad Date: Sun, 10 Dec 2023 18:35:21 +0200 Subject: [PATCH 05/18] fix: pyroscope series inconsistencies --- lib/db/clickhouse.js | 20 +++++++++++++------- lib/db/maintain/scripts.js | 19 ++++++++++--------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/lib/db/clickhouse.js b/lib/db/clickhouse.js index a704fe5f..48fd0d77 100644 --- a/lib/db/clickhouse.js +++ b/lib/db/clickhouse.js @@ -1353,13 +1353,19 @@ const samplesReadTable = { * @param config {Object?} * @returns {Promise>} */ -const rawRequest = (query, data, database, config) => { - const getParams = [ - (database ? `database=${encodeURIComponent(database)}` : null), - (data ? `query=${encodeURIComponent(query)}` : null) - ].filter(p => p) - const url = `${getClickhouseUrl()}/${getParams.length ? `?${getParams.join('&')}` : ''}` - return axios.post(url, data || query, config) +const rawRequest = async (query, data, database, config) => { + try { + const getParams = [ + (database ? `database=${encodeURIComponent(database)}` : null), + (data ? `query=${encodeURIComponent(query)}` : null) + ].filter(p => p) + const url = `${getClickhouseUrl()}/${getParams.length ? `?${getParams.join('&')}` : ''}` + return await axios.post(url, data || query, config) + } catch (e) { + logger.error('rawRequest error: ' + query) + e.response?.data && logger.error(e.response.data.toString()) + throw e + } } /** diff --git a/lib/db/maintain/scripts.js b/lib/db/maintain/scripts.js index a08624f8..a89d01e0 100644 --- a/lib/db/maintain/scripts.js +++ b/lib/db/maintain/scripts.js @@ -266,10 +266,8 @@ module.exports.profiles = [ )) as _tags) as fingerprint, _type_id as type_id, service_name, - _tags as tags, unhex(profile_id)::FixedString(16) as profile_id, duration_ns, - value, payload_type, payload FROM profiles_input`, @@ -287,11 +285,13 @@ module.exports.profiles = [ `CREATE MATERIALIZED VIEW IF NOT EXISTS profiles_series_mv {{{OnCluster}}} TO profiles_series AS SELECT toDate(intDiv(timestamp_ns, 1000000000)) as date, - type_id, + concatWithSeparator(':', type, period_type, period_unit) as type_id, service_name, - fingerprint, + cityHash64(arraySort(arrayConcat( + profiles_input.tags, [('__type__', type_id), ('service_name', service_name)] + )) as _tags) as fingerprint, tags - FROM profiles`, + FROM profiles_input`, `CREATE TABLE IF NOT EXISTS profiles_series_gin {{{OnCluster}}} ( date Date CODEC(ZSTD(1)), @@ -337,26 +337,27 @@ module.exports.profiles_dist = [ timestamp_ns UInt64, fingerprint UInt64, type_id LowCardinality(String), - tags Array(Tuple(String, String)), + service_name LowCardinality(String), profile_id String, duration_ns UInt64, - value UInt64, payload_type LowCardinality(String), payload String ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles', fingerprint);`, - `CREATE TABLE IF NOT EXISTS profiles_series {{{OnCluster}}} ( + `CREATE TABLE IF NOT EXISTS profiles_series_dist {{{OnCluster}}} ( date Date, type_id LowCardinality(String), + service_name LowCardinality(String), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), tags Array(Tuple(String, String)) CODEC(ZSTD(1)), - ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles',fingerprint);`, + ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles_series',fingerprint);`, `CREATE TABLE IF NOT EXISTS profiles_series_gin_dist {{{OnCluster}}} ( date Date, key String, val String, type_id LowCardinality(String), + service_name LowCardinality(String), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles_series_gin',fingerprint);`, From bf95d2d6d7544fa343878274f87bb1c4937629b4 Mon Sep 17 00:00:00 2001 From: akvlad Date: Tue, 2 Jan 2024 13:27:41 +0200 Subject: [PATCH 06/18] drop profile_id --- lib/db/maintain/scripts.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/db/maintain/scripts.js b/lib/db/maintain/scripts.js index a89d01e0..716bca7b 100644 --- a/lib/db/maintain/scripts.js +++ b/lib/db/maintain/scripts.js @@ -234,7 +234,6 @@ module.exports.traces_dist = [ module.exports.profiles = [ `CREATE TABLE IF NOT EXISTS profiles_input {{{OnCluster}}} ( timestamp_ns UInt64, - profile_id FixedString(16), type LowCardinality(String), service_name LowCardinality(String), period_type LowCardinality(String), @@ -250,7 +249,6 @@ module.exports.profiles = [ fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), type_id LowCardinality(String) CODEC(ZSTD(1)), service_name LowCardinality(String) CODEC(ZSTD(1)), - profile_id FixedString(16) CODEC(ZSTD(1)), duration_ns UInt64 CODEC(DoubleDelta, ZSTD(1)), payload_type LowCardinality(String) CODEC(ZSTD(1)), payload String CODEC(ZSTD(1)) @@ -266,7 +264,6 @@ module.exports.profiles = [ )) as _tags) as fingerprint, _type_id as type_id, service_name, - unhex(profile_id)::FixedString(16) as profile_id, duration_ns, payload_type, payload @@ -338,7 +335,6 @@ module.exports.profiles_dist = [ fingerprint UInt64, type_id LowCardinality(String), service_name LowCardinality(String), - profile_id String, duration_ns UInt64, payload_type LowCardinality(String), payload String From 0286f27414832c78588ab105e513517eb2acc0c5 Mon Sep 17 00:00:00 2001 From: akvlad Date: Mon, 22 Jan 2024 16:54:23 +0200 Subject: [PATCH 07/18] selectMergeStacktraces rust impl --- pyroscope/pprof-bin/.gitignore | 8 + pyroscope/pprof-bin/Cargo.toml | 40 +++ pyroscope/pprof-bin/Makefile | 5 + pyroscope/pprof-bin/build.rs | 6 + pyroscope/pprof-bin/pkg/package.json | 14 + pyroscope/pprof-bin/pkg/pprof_bin.d.ts | 20 ++ pyroscope/pprof-bin/pkg/pprof_bin.js | 207 ++++++++++++++ pyroscope/pprof-bin/pkg/pprof_bin_bg.wasm | Bin 0 -> 72951 bytes .../pprof-bin/pkg/pprof_bin_bg.wasm.d.ts | 11 + pyroscope/pprof-bin/src/lib.rs | 262 ++++++++++++++++++ pyroscope/pprof-bin/src/utils.rs | 1 + pyroscope/pprof.js | 154 ++++++++++ pyroscope/pyroscope.js | 200 +++++++++++++ test/e2e | 2 +- 14 files changed, 929 insertions(+), 1 deletion(-) create mode 100644 pyroscope/pprof-bin/.gitignore create mode 100644 pyroscope/pprof-bin/Cargo.toml create mode 100644 pyroscope/pprof-bin/Makefile create mode 100644 pyroscope/pprof-bin/build.rs create mode 100644 pyroscope/pprof-bin/pkg/package.json create mode 100644 pyroscope/pprof-bin/pkg/pprof_bin.d.ts create mode 100644 pyroscope/pprof-bin/pkg/pprof_bin.js create mode 100644 pyroscope/pprof-bin/pkg/pprof_bin_bg.wasm create mode 100644 pyroscope/pprof-bin/pkg/pprof_bin_bg.wasm.d.ts create mode 100644 pyroscope/pprof-bin/src/lib.rs create mode 100644 pyroscope/pprof-bin/src/utils.rs create mode 100644 pyroscope/pprof.js create mode 100644 pyroscope/pyroscope.js diff --git a/pyroscope/pprof-bin/.gitignore b/pyroscope/pprof-bin/.gitignore new file mode 100644 index 00000000..f747c98a --- /dev/null +++ b/pyroscope/pprof-bin/.gitignore @@ -0,0 +1,8 @@ +/target +**/*.rs.bk +Cargo.lock +bin/ +wasm-pack.log +.appveyor.yml +.travis.yml +README.md diff --git a/pyroscope/pprof-bin/Cargo.toml b/pyroscope/pprof-bin/Cargo.toml new file mode 100644 index 00000000..07b59dcb --- /dev/null +++ b/pyroscope/pprof-bin/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "pprof-bin" +version = "0.1.0" +authors = ["akvlad90@gmail.com"] +edition = "2018" +build = "build.rs" + +[lib] +crate-type = ["cdylib", "rlib"] + +[features] +default = ["console_error_panic_hook"] + +[dependencies] +wasm-bindgen = "0.2.84" +bytes = "1.5.0" +prost = "0.12.3" +json = "0.12.4" +lazy_static = "1.4.0" + +# The `console_error_panic_hook` crate provides better debugging of panics by +# logging them with `console.error`. This is great for development, but requires +# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for +# code size when deploying. +console_error_panic_hook = { version = "0.1.7", optional = true } + +[dev-dependencies] +wasm-bindgen-test = "0.3.34" + +[profile.release] +# Tell `rustc` to optimize for small code size. +opt-level = "s" + +[build-dependencies] +prost-build = { version = "0.12.3" } + +[dependencies.web-sys] +version = "0.3.67" +features = ["console"] + diff --git a/pyroscope/pprof-bin/Makefile b/pyroscope/pprof-bin/Makefile new file mode 100644 index 00000000..64e718a9 --- /dev/null +++ b/pyroscope/pprof-bin/Makefile @@ -0,0 +1,5 @@ +.PHONY: build + +build: + wasm-pack build --target nodejs + rm -rf pkg/.gitignore pkg/README.md diff --git a/pyroscope/pprof-bin/build.rs b/pyroscope/pprof-bin/build.rs new file mode 100644 index 00000000..f02ce147 --- /dev/null +++ b/pyroscope/pprof-bin/build.rs @@ -0,0 +1,6 @@ +use std::io::Result; + +fn main() -> Result<()> { + prost_build::compile_protos(&["../proto/querier.proto"], &["../proto"])?; + Ok(()) +} diff --git a/pyroscope/pprof-bin/pkg/package.json b/pyroscope/pprof-bin/pkg/package.json new file mode 100644 index 00000000..a2cf499e --- /dev/null +++ b/pyroscope/pprof-bin/pkg/package.json @@ -0,0 +1,14 @@ +{ + "name": "pprof-bin", + "collaborators": [ + "akvlad90@gmail.com" + ], + "version": "0.1.0", + "files": [ + "pprof_bin_bg.wasm", + "pprof_bin.js", + "pprof_bin.d.ts" + ], + "main": "pprof_bin.js", + "types": "pprof_bin.d.ts" +} \ No newline at end of file diff --git a/pyroscope/pprof-bin/pkg/pprof_bin.d.ts b/pyroscope/pprof-bin/pkg/pprof_bin.d.ts new file mode 100644 index 00000000..0f53ddde --- /dev/null +++ b/pyroscope/pprof-bin/pkg/pprof_bin.d.ts @@ -0,0 +1,20 @@ +/* tslint:disable */ +/* eslint-disable */ +/** +* @param {number} id +* @param {Uint8Array} bytes +* @param {string} sample_type +*/ +export function merge_tree(id: number, bytes: Uint8Array, sample_type: string): void; +/** +* @param {number} id +* @returns {Uint8Array} +*/ +export function export_tree(id: number): Uint8Array; +/** +* @param {number} id +*/ +export function drop_tree(id: number): void; +/** +*/ +export function init_panic_hook(): void; diff --git a/pyroscope/pprof-bin/pkg/pprof_bin.js b/pyroscope/pprof-bin/pkg/pprof_bin.js new file mode 100644 index 00000000..81d7b0b2 --- /dev/null +++ b/pyroscope/pprof-bin/pkg/pprof_bin.js @@ -0,0 +1,207 @@ +let imports = {}; +imports['__wbindgen_placeholder__'] = module.exports; +let wasm; +const { TextEncoder, TextDecoder } = require(`util`); + +const heap = new Array(128).fill(undefined); + +heap.push(undefined, null, true, false); + +function getObject(idx) { return heap[idx]; } + +let heap_next = heap.length; + +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + +let cachedUint8Memory0 = null; + +function getUint8Memory0() { + if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { + cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8Memory0; +} + +let WASM_VECTOR_LEN = 0; + +function passArray8ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 1, 1) >>> 0; + getUint8Memory0().set(arg, ptr / 1); + WASM_VECTOR_LEN = arg.length; + return ptr; +} + +let cachedTextEncoder = new TextEncoder('utf-8'); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8Memory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8Memory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} +/** +* @param {number} id +* @param {Uint8Array} bytes +* @param {string} sample_type +*/ +module.exports.merge_tree = function(id, bytes, sample_type) { + const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passStringToWasm0(sample_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + wasm.merge_tree(id, ptr0, len0, ptr1, len1); +}; + +let cachedInt32Memory0 = null; + +function getInt32Memory0() { + if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { + cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); + } + return cachedInt32Memory0; +} + +function getArrayU8FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); +} +/** +* @param {number} id +* @returns {Uint8Array} +*/ +module.exports.export_tree = function(id) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.export_tree(retptr, id); + var r0 = getInt32Memory0()[retptr / 4 + 0]; + var r1 = getInt32Memory0()[retptr / 4 + 1]; + var v1 = getArrayU8FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } +}; + +/** +* @param {number} id +*/ +module.exports.drop_tree = function(id) { + wasm.drop_tree(id); +}; + +/** +*/ +module.exports.init_panic_hook = function() { + wasm.init_panic_hook(); +}; + +let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); +} + +function addHeapObject(obj) { + if (heap_next === heap.length) heap.push(heap.length + 1); + const idx = heap_next; + heap_next = heap[idx]; + + heap[idx] = obj; + return idx; +} + +module.exports.__wbg_new_abda76e883ba8a5f = function() { + const ret = new Error(); + return addHeapObject(ret); +}; + +module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) { + const ret = getObject(arg1).stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; + +module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } +}; + +module.exports.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); +}; + +const path = require('path').join(__dirname, 'pprof_bin_bg.wasm'); +const bytes = require('fs').readFileSync(path); + +const wasmModule = new WebAssembly.Module(bytes); +const wasmInstance = new WebAssembly.Instance(wasmModule, imports); +wasm = wasmInstance.exports; +module.exports.__wasm = wasm; + diff --git a/pyroscope/pprof-bin/pkg/pprof_bin_bg.wasm b/pyroscope/pprof-bin/pkg/pprof_bin_bg.wasm new file mode 100644 index 0000000000000000000000000000000000000000..c9c7490013f68b8d2c6f323ed2616b8239292bf1 GIT binary patch literal 72951 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 ag||&)5VqniWH(%y*-9?8KHaKs%Ks07Wufc< literal 0 HcmV?d00001 diff --git a/pyroscope/pprof-bin/pkg/pprof_bin_bg.wasm.d.ts b/pyroscope/pprof-bin/pkg/pprof_bin_bg.wasm.d.ts new file mode 100644 index 00000000..febd251b --- /dev/null +++ b/pyroscope/pprof-bin/pkg/pprof_bin_bg.wasm.d.ts @@ -0,0 +1,11 @@ +/* tslint:disable */ +/* eslint-disable */ +export const memory: WebAssembly.Memory; +export function merge_tree(a: number, b: number, c: number, d: number, e: number): void; +export function export_tree(a: number, b: number): void; +export function drop_tree(a: number): void; +export function init_panic_hook(): void; +export function __wbindgen_malloc(a: number, b: number): number; +export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; +export function __wbindgen_add_to_stack_pointer(a: number): number; +export function __wbindgen_free(a: number, b: number, c: number): void; diff --git a/pyroscope/pprof-bin/src/lib.rs b/pyroscope/pprof-bin/src/lib.rs new file mode 100644 index 00000000..912fc1ba --- /dev/null +++ b/pyroscope/pprof-bin/src/lib.rs @@ -0,0 +1,262 @@ +#![allow(unused_assignments)] +mod utils; + +use lazy_static::lazy_static; +use pprof_pb::google::v1::Function; +use pprof_pb::google::v1::Location; +use pprof_pb::google::v1::Profile; +use pprof_pb::querier::v1::FlameGraph; +use pprof_pb::querier::v1::Level; +use pprof_pb::querier::v1::SelectMergeStacktracesResponse; +use prost::Message; +use std::collections::HashMap; +use std::sync::Mutex; +use std::vec::Vec; +use wasm_bindgen::prelude::*; + +pub mod pprof_pb { + + pub mod google { + pub mod v1 { + include!(concat!(env!("OUT_DIR"), "/google.v1.rs")); + } + } + pub mod types { + pub mod v1 { + include!(concat!(env!("OUT_DIR"), "/types.v1.rs")); + } + } + pub mod querier { + pub mod v1 { + include!(concat!(env!("OUT_DIR"), "/querier.v1.rs")); + } + } +} + +struct TreeNode { + name_idx: usize, + prepend: i64, + total: i64, + _self: i64, + children: Vec, +} + +impl TreeNode { + fn append_child(&mut self, _name_idx: usize) { + self.children.push(TreeNode { + name_idx: _name_idx, + prepend: 0, + total: 0, + _self: 0, + children: Vec::new(), + }); + } +} + +struct Tree { + names: Vec, + names_map: HashMap, + root: TreeNode, + sample_type: String, + max_self: i64, +} + +unsafe fn merge(tree: &mut Tree, p: &Profile) { + let mut functions: HashMap = HashMap::new(); + for f in p.function.iter() { + functions.insert(f.id, &f); + } + let mut locations: HashMap = HashMap::new(); + for l in p.location.iter() { + locations.insert(l.id, &l); + } + + let mut value_idx: i32 = -1; + for i in 0..p.sample_type.len() { + let sample_type = format!( + "{}:{}", + p.string_table[p.sample_type[i].r#type as usize], + p.string_table[p.sample_type[i].unit as usize] + ); + if tree.sample_type == sample_type { + value_idx = i as i32; + break; + } + } + + if value_idx == -1 { + return; + } + for i in 0..p.location.len() { + let l = &p.location[i]; + let line = &p.string_table[functions[&l.line[0].function_id].name as usize]; + if tree.names_map.contains_key(line) { + continue; + } + tree.names.push(line.clone()); + tree.names_map.insert(line.clone(), tree.names.len() - 1); + } + + for s in p.sample.iter() { + let mut node = &mut tree.root; + for i in (0..s.location_id.len()).rev() { + let location = locations[&s.location_id[i]]; + let name_idx = tree.names_map + [&p.string_table[functions[&location.line[0].function_id].name as usize]]; + let mut node_idx: i32 = -1; + for j in 0..node.children.len() { + if node.children[j].name_idx == name_idx { + node_idx = j as i32; + break; + } + } + if node_idx == -1 { + node.append_child(name_idx); + node_idx = (node.children.len() as i32) - 1; + } + node = &mut node.children[node_idx as usize]; + node.total += s.value[value_idx as usize]; + if i == 0 { + node._self += s.value[value_idx as usize]; + if node._self > tree.max_self { + tree.max_self = node._self + } + } + } + } + tree.root.total = 0; + for c in tree.root.children.iter() { + tree.root.total += c.total; + } +} + +/*fn read_uleb128(bytes: &[u8]) -> (usize, usize) { + let mut result = 0; + let mut shift = 0; + loop { + let byte = bytes[shift]; + result |= ((byte & 0x7f) as usize) << (shift * 7); + shift += 1; + if byte & 0x80 == 0 { + break; + } + } + (result, shift) +}*/ + +static mut INTS: [i64; 4000000] = [0; 4000000]; + +unsafe fn bfs(t: &mut Tree, res: &mut Vec<&[i64]>) { + let mut valid_refs = true; + // suppress irrelevant warnings + let mut prepend: i64 = 0; + let mut k = 4; + INTS[0] = 0; + INTS[1] = t.root.total; + INTS[2] = t.root._self; + INTS[3] = t.root.name_idx as i64; + res.push(&INTS[0..4]); + let mut refs: Vec<*mut TreeNode> = vec![&mut t.root]; + let mut _refs: Vec<*mut TreeNode> = vec![]; + while valid_refs { + valid_refs = false; + prepend = 0; + let _k = k; + for i in 0..refs.len() { + let _ref = refs[i]; + prepend += (*_ref).prepend; + for j in 0..(*_ref).children.len() { + valid_refs = true; + (*_ref).children[j].prepend += prepend; + INTS[k] = (*_ref).children[j].prepend; + INTS[k + 1] = (*_ref).children[j].total; + INTS[k + 2] = (*_ref).children[j]._self; + INTS[k + 3] = (*_ref).children[j].name_idx as i64; + prepend = 0; + _refs.push(&mut (*_ref).children[j]); + + k += 4; + } + if (*_ref).children.len() == 0 { + prepend += (*_ref).total; + } else { + prepend += (*_ref)._self + } + } + res.push(&INTS[_k..k]); + std::mem::swap(&mut refs, &mut _refs); + _refs.clear(); + } +} + +lazy_static! { + static ref CTX: Mutex> = Mutex::new(HashMap::new()); +} + +#[wasm_bindgen] +pub unsafe fn merge_tree(id: u32, bytes: &[u8], sample_type: String) { + let mut ctx = CTX.lock().unwrap(); + if !ctx.contains_key(&id) { + ctx.insert( + id, + Tree { + names: Vec::new(), + names_map: HashMap::new(), + root: TreeNode { + name_idx: 0, + _self: 0, + children: vec![], + prepend: 0, + total: 0, + }, + sample_type, + max_self: 0, + }, + ); + } + + let mut tree = ctx.get_mut(&id).unwrap(); + tree.names.push("total".to_string()); + tree.names_map.insert("total".to_string(), 0); + + let prof = Profile::decode(bytes).unwrap(); + merge(&mut tree, &prof); +} + +#[wasm_bindgen] +pub unsafe fn export_tree(id: u32) -> Vec { + let mut ctx = CTX.lock().unwrap(); + let mut res = SelectMergeStacktracesResponse::default(); + if !ctx.contains_key(&id) { + return res.encode_to_vec(); + } + let tree = (*ctx).get_mut(&id).unwrap(); + let mut fg = FlameGraph::default(); + fg.names = tree.names.clone(); + let mut levels: Vec<&[i64]> = Vec::new(); + bfs(tree, &mut levels); + for l in levels { + let mut level = Level::default(); + for v in l.iter() { + level.values.push(*v); + } + fg.levels.push(level); + } + fg.total = tree.root.total; + fg.max_self = tree.max_self; + res.flamegraph = Some(fg); + res.encode_to_vec() +} + +#[wasm_bindgen] +pub unsafe fn drop_tree(id: u32) { + let mut ctx = CTX.lock().unwrap(); + if ctx.contains_key(&id) { + ctx.remove(&id); + } +} + +#[wasm_bindgen] +pub fn init_panic_hook() { + console_error_panic_hook::set_once(); +} diff --git a/pyroscope/pprof-bin/src/utils.rs b/pyroscope/pprof-bin/src/utils.rs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/pyroscope/pprof-bin/src/utils.rs @@ -0,0 +1 @@ + diff --git a/pyroscope/pprof.js b/pyroscope/pprof.js new file mode 100644 index 00000000..e261d79e --- /dev/null +++ b/pyroscope/pprof.js @@ -0,0 +1,154 @@ +const messages = require('./profile_pb') + +/** + * + * @param buf {Uint8Array} + * @returns {*} + * @constructor + */ +const readULeb32 = (buf, start) => { + let res = 0 + let i = start + for (; (buf[i] & 0x80) === 0x80; i++) { + res |= (buf[i] & 0x7f) << ((i - start) * 7) + } + res |= (buf[i] & 0x7f) << ((i - start) * 7) + return [res, i - start + 1] +} + +class TreeNode { + constructor (nameIdx, total, self, children) { + this.nameIdx = nameIdx || 0 + this.prepend = BigInt(0) + this.total = total || BigInt(0) + this.self = self || BigInt(0) + this.children = children || [] + } +} + +class Tree { + constructor () { + this.names = ['total'] + this.namesMap = { total: 0 } + this.root = new TreeNode() + this.sampleType = [] + this.maxSelf = BigInt(0) + } + + /** + * + * @param {Profile} prof + */ + merge (prof) { + const functions = prof.getFunctionList().reduce((a, b) => { + a[b.getId()] = prof.getStringTableList()[b.getName()] + return a + }, {}) + + const locations = prof.getLocationList().reduce((a, b) => { + a[b.getId()] = b + return a + }, {}) + const getFnName = (l) => functions[l.getLineList()[0].getFunctionId()] + + const valueIdx = prof.getSampleTypeList().findIndex((type) => + this.sampleType === `${prof.getStringTableList()[type.getType()]}:${prof.getStringTableList()[type.getUnit()]}` + ) + + for (const l of prof.getLocationList()) { + const line = getFnName(l) + if (this.namesMap[line]) { + continue + } + this.names.push(line) + this.namesMap[line] = this.names.length - 1 + } + for (const s of prof.getSampleList()) { + let node = this.root + for (let i = s.getLocationIdList().length - 1; i >= 0; i--) { + const location = locations[s.getLocationIdList()[i]] + const nameIdx = this.namesMap[getFnName(location)] + let nodeIdx = node.children.findIndex(c => c.nameIdx === nameIdx) + if (nodeIdx === -1) { + node.children.push(new TreeNode(nameIdx)) + nodeIdx = node.children.length - 1 + } + node = node.children[nodeIdx] + node.total += BigInt(s.getValueList()[valueIdx]) + if (i === 0) { + node.self += BigInt(s.getValueList()[valueIdx]) + if (node.self > this.maxSelf) { + this.maxSelf = node.self + } + } + } + } + this.root.total = this.root.children.reduce((a, b) => a + b.total, BigInt(0)) + } +} + +/** + * + * @param t {Tree} + * @returns {BigInt[][]} + */ +const bfs = (t) => { + let refs = [t.root] + let validRefs = true + let prepend = BigInt(0) + const putPrepend = (v) => { + prepend += v + } + const getPrepend = () => { + const res = prepend + prepend = BigInt(0) + return res + } + const res = [[0, parseInt(t.root.total), parseInt(t.root.self), t.root.nameIdx]] + for (;validRefs;) { + validRefs = false + getPrepend() + const _res = [] + const _refs = [] + for (const r of refs) { + putPrepend(r.prepend) + for (const c of r.children) { + validRefs = true + c.prepend = getPrepend() + _res.push(parseInt(c.prepend), parseInt(c.total), parseInt(c.self), c.nameIdx) + } + _refs.push.apply(_refs, r.children) + if (r.children.length === 0) { + putPrepend(r.total) + } else { + putPrepend(r.self) + } + } + res.push(_res) + refs = _refs + } + return res +} + +/** + * + * @param {Uint8Array[]} pprofBinaries + * @param {string} sampleType + */ +const createFlameGraph = (pprofBinaries, sampleType) => { + console.log(`got ${pprofBinaries.length} profiles`) + const tree = new Tree() + tree.sampleType = sampleType + let start = Date.now() + for (const p of pprofBinaries) { + const prof = messages.Profile.deserializeBinary(p) + tree.merge(prof) + } + console.log(`ds + merge took ${Date.now() - start} ms`) + start = Date.now() + const levels = bfs(tree) + console.log(`bfs took ${Date.now() - start} ms`) + return { levels: levels, names: tree.names, total: parseInt(tree.root.total), maxSelf: parseInt(tree.maxSelf) } +} + +module.exports = { createFlameGraph, readULeb32 } diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js new file mode 100644 index 00000000..b7211c6b --- /dev/null +++ b/pyroscope/pyroscope.js @@ -0,0 +1,200 @@ +const messages = require('./querier_pb') +const types = require('./types/v1/types_pb') +const services = require('./querier_grpc_pb') +const clickhouse = require('../lib/db/clickhouse') +const { DATABASE_NAME } = require('../lib/utils') +const Sql = require('@cloki/clickhouse-sql') +const { pyroscopeSelectMergeStacktraces } = require('../wasm_parts/main') +const compiler = require('../parser/bnf') +const { createFlameGraph, readULeb32 } = require('./pprof') +const pprofBin = require('./pprof-bin/pkg/pprof_bin') + +const profileTypesHandler = async (req, res) => { + const _res = new messages.ProfileTypesResponse() + const fromTimeSec = req.body && req.body.getStart + ? parseInt(req.body.getStart()) / 1000 + : (Date.now() - 1000 * 60 * 60 * 48) / 1000 + const toTimeSec = req.body && req.body.getEnd + ? parseInt(req.body.getEnd()) / 1000 + : Date.now() / 1000 + const profileTypes = await clickhouse.rawRequest(`SELECT DISTINCT type_id, sample_type_unit +FROM profiles_series ARRAY JOIN sample_types_units as sample_type_unit +WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, + null, DATABASE_NAME()) + _res.setProfileTypesList(profileTypes.data.data.map(profileType => { + const pt = new types.ProfileType() + const [name, periodType, periodUnit] = profileType.type_id.split(':') + pt.setId(profileType.type_id + ':' + profileType.sample_type_unit[0] + ':' + profileType.sample_type_unit[1]) + pt.setName(name) + pt.setSampleType(profileType.sample_type_unit[0]) + pt.setSampleUnit(profileType.sample_type_unit[1]) + pt.setPeriodType(periodType) + pt.setPeriodUnit(periodUnit) + return pt + })) + return res.code(200).send(Buffer.from(_res.serializeBinary())) +} + +const labelNames = async (req, res) => { + const fromTimeSec = req.body && req.body.getStart + ? parseInt(req.body.getStart()) / 1000 + : (Date.now() - 1000 * 60 * 60 * 48) / 1000 + const toTimeSec = req.body && req.body.getEnd + ? parseInt(req.body.getEnd()) / 1000 + : Date.now() / 1000 + const labelNames = await clickhouse.rawRequest(`SELECT DISTINCT key +FROM profiles_series_keys +WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, + null, DATABASE_NAME()) + const resp = new types.LabelNamesResponse() + resp.setNamesList(labelNames.data.data.map(label => label.key)) + return res.code(200).send(Buffer.from(resp.serializeBinary())) +} + +const labelValues = async (req, res) => { + const name = req.body && req.body.getName + ? req.body.getName() + : '' + const fromTimeSec = req.body && req.body.getStart && req.body.getStart() + ? parseInt(req.body.getStart()) / 1000 + : (Date.now() - 1000 * 60 * 60 * 48) / 1000 + const toTimeSec = req.body && req.body.getEnd && req.body.getEnd() + ? parseInt(req.body.getEnd()) / 1000 + : Date.now() / 1000 + if (!name) { + throw new Error('No name provided') + } + const labelValues = await clickhouse.rawRequest(`SELECT DISTINCT val +FROM profiles_series_gin +WHERE key = ${Sql.quoteVal(name)} AND +date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND +date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, null, DATABASE_NAME()) + const resp = new types.LabelValuesResponse() + resp.setNamesList(labelValues.data.data.map(label => label.val)) + return res.code(200).send(Buffer.from(resp.serializeBinary())) +} + +const parser = (MsgClass) => { + return async (req, payload) => { + const _body = [] + payload.on('data', data => { + _body.push(data)// += data.toString() + }) + if (payload.isPaused && payload.isPaused()) { + payload.resume() + } + await new Promise(resolve => { + payload.on('end', resolve) + payload.on('close', resolve) + }) + const body = Buffer.concat(_body) + if (body.length === 0) { + return null + } + req._rawBody = body + return MsgClass.deserializeBinary(body) + } +} + +let ctxIdx = 0 + +const selectMergeStacktraces = async (req, res) => { + const typeRe = req.body.getProfileTypeid().match(/^(.+):([^:]+):([^:]+)$/) + const sel = req.body.getLabelSelector() + const fromTimeSec = req.body && req.body.getStart() + ? Math.floor(parseInt(req.body.getStart()) / 1000) + : Math.floor((Date.now() - 1000 * 60 * 60 * 48) / 1000) + const toTimeSec = req.body && req.body.getEnd() + ? Math.floor(parseInt(req.body.getEnd()) / 1000) + : Math.floor(Date.now() / 1000) + const query = sel ? compiler.ParseScript(sel).rootToken : null + const idxSelect = (new Sql.Select()) + .select('fingerprint') + .from('profiles_series_gin') + .where( + Sql.And( + Sql.Eq(new Sql.Raw(`has(sample_types_units, (${Sql.quoteVal(typeRe[2])},${Sql.quoteVal(typeRe[3])}))`), 1), + Sql.Eq('type_id', Sql.val(typeRe[1])), + Sql.Gte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)}))`)), + Sql.Lte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)}))`)) + ) + ).groupBy('fingerprint') + if (query) { + const labelsConds = [] + for (const rule of query.Children('log_stream_selector_rule')) { + const val = JSON.parse(rule.Child('quoted_str').value) + const labelSubCond = Sql.And( + Sql.Eq('key', Sql.val(rule.Child('label').value)), + Sql.Eq('val', Sql.val(val)) + ) + labelsConds.push(labelSubCond) + } + idxSelect.where(Sql.Or(...labelsConds)) + idxSelect.having(Sql.Eq( + new Sql.Raw(labelsConds.map((cond, i) => { + return `bitShiftLeft(toUInt64(${cond}), ${i})` + }).join('+')), + new Sql.Raw(`bitShiftLeft(toUInt64(1), ${labelsConds.length})-1`) + )) + } + const sqlReq = (new Sql.Select()) + .select('payload') + .from('profiles') + .where( + Sql.And( + Sql.Gte('timestamp_ns', new Sql.Raw(Math.floor(fromTimeSec) + '000000000')), + Sql.Lte('timestamp_ns', new Sql.Raw(Math.floor(toTimeSec) + '000000000')), + new Sql.In('fingerprint', 'IN', idxSelect) + )) + const profiles = await clickhouse.rawRequest(sqlReq.toString() + 'FORMAT RowBinary', null, DATABASE_NAME(), { + responseType: 'arraybuffer' + }) + const binData = Uint8Array.from(profiles.data) + require('./pprof-bin/pkg/pprof_bin').init_panic_hook() + const promises = [] + const _ctxIdx = ++ctxIdx + for (let i = 0; i < binData.length;) { + const [size, shift] = readULeb32(binData, i) + const uarray = Uint8Array.from(profiles.data.slice(i + shift, i + size + shift)) + i += size + shift + promises.push(new Promise((resolve, reject) => setTimeout(() => { + try { + pprofBin.merge_tree(_ctxIdx, uarray, `${typeRe[2]}:${typeRe[3]}`) + resolve() + } catch (e) { + reject(e) + } + }, 0))) + } + let sResp = null + try { + await Promise.all(promises) + sResp = pprofBin.export_tree(_ctxIdx) + } finally { + try { pprofBin.drop_tree(_ctxIdx) } catch (e) { req.log.error(e) } + } + return res.code(200).send(Buffer.from(sResp)) +} + +const selectSeries = (req, res) => { + const resp = new messages.SelectSeriesResponse() + resp.setSeriesList([]) + return res.code(200).send(Buffer.from(resp.serializeBinary())) +} + +module.exports.init = (fastify) => { + const fns = { + profileTypes: profileTypesHandler, + labelNames: labelNames, + labelValues: labelValues, + selectMergeStacktraces: selectMergeStacktraces, + selectSeries: selectSeries + } + for (const name of Object.keys(fns)) { + fastify.post(services.QuerierServiceService[name].path, (req, res) => { + return fns[name](req, res) + }, { + '*': parser(services.QuerierServiceService[name].requestType) + }) + } +} diff --git a/test/e2e b/test/e2e index e61bfa08..fc6ab17e 160000 --- a/test/e2e +++ b/test/e2e @@ -1 +1 @@ -Subproject commit e61bfa08b41ae37e71eb962fd869065ba9421d5a +Subproject commit fc6ab17eb3946cb84c7a5d2114c51c67e272e6be From 9fb65ba2716af864ac1c707800b1e88056d33ac0 Mon Sep 17 00:00:00 2001 From: akvlad Date: Tue, 23 Jan 2024 13:59:43 +0200 Subject: [PATCH 08/18] fix: configurable timespan --- pyroscope/pyroscope.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js index b7211c6b..961fbebe 100644 --- a/pyroscope/pyroscope.js +++ b/pyroscope/pyroscope.js @@ -9,11 +9,13 @@ const compiler = require('../parser/bnf') const { createFlameGraph, readULeb32 } = require('./pprof') const pprofBin = require('./pprof-bin/pkg/pprof_bin') +const HISTORY_TIMESPAN = 1000 * 60 * 60 * 24 * 7 + const profileTypesHandler = async (req, res) => { const _res = new messages.ProfileTypesResponse() const fromTimeSec = req.body && req.body.getStart ? parseInt(req.body.getStart()) / 1000 - : (Date.now() - 1000 * 60 * 60 * 48) / 1000 + : (Date.now() - HISTORY_TIMESPAN) / 1000 const toTimeSec = req.body && req.body.getEnd ? parseInt(req.body.getEnd()) / 1000 : Date.now() / 1000 @@ -38,7 +40,7 @@ WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDa const labelNames = async (req, res) => { const fromTimeSec = req.body && req.body.getStart ? parseInt(req.body.getStart()) / 1000 - : (Date.now() - 1000 * 60 * 60 * 48) / 1000 + : (Date.now() - HISTORY_TIMESPAN) / 1000 const toTimeSec = req.body && req.body.getEnd ? parseInt(req.body.getEnd()) / 1000 : Date.now() / 1000 @@ -57,7 +59,7 @@ const labelValues = async (req, res) => { : '' const fromTimeSec = req.body && req.body.getStart && req.body.getStart() ? parseInt(req.body.getStart()) / 1000 - : (Date.now() - 1000 * 60 * 60 * 48) / 1000 + : (Date.now() - HISTORY_TIMESPAN) / 1000 const toTimeSec = req.body && req.body.getEnd && req.body.getEnd() ? parseInt(req.body.getEnd()) / 1000 : Date.now() / 1000 From de5569608a28d7ae23d46898399131028f8c1ffa Mon Sep 17 00:00:00 2001 From: akvlad Date: Tue, 23 Jan 2024 19:48:26 +0200 Subject: [PATCH 09/18] selectSeries handler --- pyroscope/pyroscope.js | 186 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 165 insertions(+), 21 deletions(-) diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js index 961fbebe..3a24916a 100644 --- a/pyroscope/pyroscope.js +++ b/pyroscope/pyroscope.js @@ -8,6 +8,7 @@ const { pyroscopeSelectMergeStacktraces } = require('../wasm_parts/main') const compiler = require('../parser/bnf') const { createFlameGraph, readULeb32 } = require('./pprof') const pprofBin = require('./pprof-bin/pkg/pprof_bin') +const { QrynBadRequest } = require('../lib/handlers/errors') const HISTORY_TIMESPAN = 1000 * 60 * 60 * 24 * 7 @@ -100,6 +101,48 @@ const parser = (MsgClass) => { let ctxIdx = 0 +/** + * + * @param {Sql.Select} query + * @param {string} labelSelector + */ +const labelSelectorQuery = (query, labelSelector) => { + if (!labelSelector || !labelSelector.length || labelSelector === '{}') { + return query + } + const labelSelectorScript = compiler.ParseScript(labelSelector).rootToken + const labelsConds = [] + for (const rule of labelSelectorScript.Children('log_stream_selector_rule')) { + const val = JSON.parse(rule.Child('quoted_str').value) + let valRul = null + switch (rule.Child('operator').value) { + case '=': + valRul = Sql.Eq(new Sql.Raw('val'), Sql.val(val)) + break + case '!=': + valRul = Sql.Ne(new Sql.Raw('val'), Sql.val(val)) + break + case '=~': + valRul = Sql.Eq(`match(val, ${Sql.quoteVal(val)})`, 1) + break + case '!~': + valRul = Sql.Ne(`match(val, ${Sql.quoteVal(val)})`, 1) + } + const labelSubCond = Sql.And( + Sql.Eq('key', Sql.val(rule.Child('label').value)), + valRul + ) + labelsConds.push(labelSubCond) + } + query.where(Sql.Or(...labelsConds)) + query.having(Sql.Eq( + new Sql.Raw(labelsConds.map((cond, i) => { + return `bitShiftLeft(toUInt64(${cond}), ${i})` + }).join('+')), + new Sql.Raw(`bitShiftLeft(toUInt64(1), ${labelsConds.length})-1`) + )) +} + const selectMergeStacktraces = async (req, res) => { const typeRe = req.body.getProfileTypeid().match(/^(.+):([^:]+):([^:]+)$/) const sel = req.body.getLabelSelector() @@ -109,7 +152,6 @@ const selectMergeStacktraces = async (req, res) => { const toTimeSec = req.body && req.body.getEnd() ? Math.floor(parseInt(req.body.getEnd()) / 1000) : Math.floor(Date.now() / 1000) - const query = sel ? compiler.ParseScript(sel).rootToken : null const idxSelect = (new Sql.Select()) .select('fingerprint') .from('profiles_series_gin') @@ -121,24 +163,7 @@ const selectMergeStacktraces = async (req, res) => { Sql.Lte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)}))`)) ) ).groupBy('fingerprint') - if (query) { - const labelsConds = [] - for (const rule of query.Children('log_stream_selector_rule')) { - const val = JSON.parse(rule.Child('quoted_str').value) - const labelSubCond = Sql.And( - Sql.Eq('key', Sql.val(rule.Child('label').value)), - Sql.Eq('val', Sql.val(val)) - ) - labelsConds.push(labelSubCond) - } - idxSelect.where(Sql.Or(...labelsConds)) - idxSelect.having(Sql.Eq( - new Sql.Raw(labelsConds.map((cond, i) => { - return `bitShiftLeft(toUInt64(${cond}), ${i})` - }).join('+')), - new Sql.Raw(`bitShiftLeft(toUInt64(1), ${labelsConds.length})-1`) - )) - } + labelSelectorQuery(idxSelect, sel) const sqlReq = (new Sql.Select()) .select('payload') .from('profiles') @@ -178,9 +203,128 @@ const selectMergeStacktraces = async (req, res) => { return res.code(200).send(Buffer.from(sResp)) } -const selectSeries = (req, res) => { +const selectSeries = async (req, res) => { + const _req = req.body + const fromTimeSec = Math.floor(req.getStart && req.getStart() + ? parseInt(req.getStart()) / 1000 + : Date.now() / 1000 - HISTORY_TIMESPAN) + const toTimeSec = Math.floor(req.getEnd && req.getEnd() + ? parseInt(req.getEnd()) / 1000 + : Date.now() / 1000) + let typeId = _req.getProfileTypeid && _req.getProfileTypeid() + if (!typeId) { + throw new QrynBadRequest('No type provided') + } + typeId = typeId.match(/^(.+):([^:]+):([^:]+)$/) + if (!typeId) { + throw new QrynBadRequest('Invalid type provided') + } + const sampleTypeId = typeId[2] + ':' + typeId[3] + const labelSelector = _req.getLabelSelector && _req.getLabelSelector() + let groupBy = _req.getGroupByList && _req.getGroupByList() + groupBy = groupBy && groupBy.length ? groupBy : null + const step = _req.getStep && parseInt(_req.getStep()) + if (!step || isNaN(step)) { + throw new QrynBadRequest('No step provided') + } + const aggregation = _req.getAggregation && _req.getAggregation() + + const idxReq = (new Sql.Select()) + .select(new Sql.Raw('fingerprint')) + .from('profiles_series_gin') + .where( + Sql.And( + Sql.Eq('type_id', Sql.val(typeId[1])), + Sql.Gte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)}))`)), + Sql.Lte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)}))`)), + Sql.Eq(new Sql.Raw( + `has(sample_types_units, (${Sql.quoteVal(typeId[2])}, ${Sql.quoteVal(typeId[3])}))`), + 1) + ) + ) + labelSelectorQuery(idxReq, labelSelector) + + const withIdxReq = (new Sql.With('idx', idxReq, false)) + + let tagsReq = 'arraySort(p.tags)' + if (groupBy) { + tagsReq = `arraySort(arrayFilter(x -> x in (${groupBy.map(g => Sql.quoteVal(g)).join(',')}), p.tags))` + } + + const labelsReq = (new Sql.Select()).with(withIdxReq).select( + 'fingerprint', + [new Sql.Raw(tagsReq), 'tags'], + [groupBy ? 'fingerprint' : new Sql.Raw('cityHash64(tags)'), 'new_fingerprint'] + ).distinct(true).from(['profiles_series', 'p']) + .where(Sql.And( + new Sql.In('fingerprint', 'IN', new Sql.WithReference(withIdxReq)), + Sql.Gte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)}))`)), + Sql.Lte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)}))`)) + )) + + const withLabelsReq = new Sql.With('labels', labelsReq, false) + + let valueCol = new Sql.Raw( + `sum(toFloat64(arrayFirst(x -> x.1 == ${Sql.quoteVal(sampleTypeId)}, p.values_agg).2))`) + if (aggregation === types.TimeSeriesAggregationType.TIME_SERIES_AGGREGATION_TYPE_AVERAGE) { + valueCol = new Sql.Raw( + `sum(toFloat64(arrayFirst(x -> x.1 == ${Sql.quoteVal(sampleTypeId)}).2, p.values_agg)) / ` + + `sum(toFloat64(arrayFirst(x -> x.1 == ${Sql.quoteVal(sampleTypeId)}).3, p.values_agg))` + ) + } + + const mainReq = (new Sql.Select()).with(withIdxReq, withLabelsReq).select( + [new Sql.Raw(`intDiv(p.timestamp_ns, 1000000000 * ${step}) * ${step} * 1000`), 'timestamp_ms'], + [new Sql.Raw('labels.new_fingerprint'), 'fingerprint'], + [new Sql.Raw('min(labels.tags)'), 'labels'], + [valueCol, 'value'] + ).from(['profiles', 'p']).join( + new Sql.WithReference(withLabelsReq), + 'ANY LEFT', + Sql.Eq(new Sql.Raw('p.fingerprint'), new Sql.Raw('labels.fingerprint')) + ).where( + Sql.And( + new Sql.In('p.fingerprint', 'IN', new Sql.WithReference(withIdxReq)), + Sql.Gte('p.timestamp_ns', new Sql.Raw(`${fromTimeSec}000000000`)), + Sql.Lt('p.timestamp_ns', new Sql.Raw(`${toTimeSec}000000000`)) + ) + ).groupBy('timestamp_ns', 'fingerprint') + .orderBy(['fingerprint', 'ASC'], ['timestamp_ns', 'ASC']) + const strMainReq = mainReq.toString() + console.log(strMainReq) + const chRes = await clickhouse + .rawRequest(strMainReq + ' FORMAT JSON', null, DATABASE_NAME()) + + let lastFingerprint = null + const seriesList = [] + let lastSeries = null + let lastPoints = [] + for (let i = 0; i < chRes.data.data.length; i++) { + const e = chRes.data.data[i] + if (lastFingerprint !== e.fingerprint) { + lastFingerprint = e.fingerprint + lastSeries && lastSeries.setPointsList(lastPoints) + lastSeries && seriesList.push(lastSeries) + lastPoints = [] + lastSeries = new types.Series() + lastSeries.setLabelsList(e.labels.map(l => { + const lp = new types.LabelPair() + lp.setName(l[0]) + lp.setValue(l[1]) + return lp + })) + } + + const p = new types.Point() + p.setValue(e.value) + p.setTimestamp(e.timestamp_ms) + lastPoints.push(p) + } + lastSeries && lastSeries.setPointsList(lastPoints) + lastSeries && seriesList.push(lastSeries) + const resp = new messages.SelectSeriesResponse() - resp.setSeriesList([]) + resp.setSeriesList(seriesList) return res.code(200).send(Buffer.from(resp.serializeBinary())) } From fbf6828e5139f504405cc6a73e0e7eb307092b99 Mon Sep 17 00:00:00 2001 From: akvlad Date: Tue, 9 Jan 2024 12:02:41 +0200 Subject: [PATCH 10/18] profiling api support init --- pyroscope/google/v1/profile_grpc_pb.js | 1 + pyroscope/google/v1/profile_pb.js | 2635 +++++++++++++++ pyroscope/proto/google/v1/profile.proto | 212 ++ pyroscope/proto/querier.proto | 133 + pyroscope/proto/types/v1/types.proto | 84 + pyroscope/pyroscope.js | 334 +- pyroscope/querier_grpc_pb.js | 318 ++ pyroscope/querier_pb.js | 3961 +++++++++++++++++++++++ pyroscope/types/v1/types_grpc_pb.js | 1 + pyroscope/types/v1/types_pb.js | 2892 +++++++++++++++++ 10 files changed, 10349 insertions(+), 222 deletions(-) create mode 100644 pyroscope/google/v1/profile_grpc_pb.js create mode 100644 pyroscope/google/v1/profile_pb.js create mode 100644 pyroscope/proto/google/v1/profile.proto create mode 100644 pyroscope/proto/querier.proto create mode 100644 pyroscope/proto/types/v1/types.proto create mode 100644 pyroscope/querier_grpc_pb.js create mode 100644 pyroscope/querier_pb.js create mode 100644 pyroscope/types/v1/types_grpc_pb.js create mode 100644 pyroscope/types/v1/types_pb.js diff --git a/pyroscope/google/v1/profile_grpc_pb.js b/pyroscope/google/v1/profile_grpc_pb.js new file mode 100644 index 00000000..97b3a246 --- /dev/null +++ b/pyroscope/google/v1/profile_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/pyroscope/google/v1/profile_pb.js b/pyroscope/google/v1/profile_pb.js new file mode 100644 index 00000000..3eab57a6 --- /dev/null +++ b/pyroscope/google/v1/profile_pb.js @@ -0,0 +1,2635 @@ +// source: google/v1/profile.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.google.v1.Function', null, global); +goog.exportSymbol('proto.google.v1.Label', null, global); +goog.exportSymbol('proto.google.v1.Line', null, global); +goog.exportSymbol('proto.google.v1.Location', null, global); +goog.exportSymbol('proto.google.v1.Mapping', null, global); +goog.exportSymbol('proto.google.v1.Profile', null, global); +goog.exportSymbol('proto.google.v1.Sample', null, global); +goog.exportSymbol('proto.google.v1.ValueType', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.google.v1.Profile = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.google.v1.Profile.repeatedFields_, null); +}; +goog.inherits(proto.google.v1.Profile, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.google.v1.Profile.displayName = 'proto.google.v1.Profile'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.google.v1.ValueType = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.google.v1.ValueType, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.google.v1.ValueType.displayName = 'proto.google.v1.ValueType'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.google.v1.Sample = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.google.v1.Sample.repeatedFields_, null); +}; +goog.inherits(proto.google.v1.Sample, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.google.v1.Sample.displayName = 'proto.google.v1.Sample'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.google.v1.Label = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.google.v1.Label, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.google.v1.Label.displayName = 'proto.google.v1.Label'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.google.v1.Mapping = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.google.v1.Mapping, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.google.v1.Mapping.displayName = 'proto.google.v1.Mapping'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.google.v1.Location = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.google.v1.Location.repeatedFields_, null); +}; +goog.inherits(proto.google.v1.Location, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.google.v1.Location.displayName = 'proto.google.v1.Location'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.google.v1.Line = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.google.v1.Line, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.google.v1.Line.displayName = 'proto.google.v1.Line'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.google.v1.Function = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.google.v1.Function, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.google.v1.Function.displayName = 'proto.google.v1.Function'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.google.v1.Profile.repeatedFields_ = [1,2,3,4,5,6,13]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.google.v1.Profile.prototype.toObject = function(opt_includeInstance) { + return proto.google.v1.Profile.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.google.v1.Profile} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Profile.toObject = function(includeInstance, msg) { + var f, obj = { + sampleTypeList: jspb.Message.toObjectList(msg.getSampleTypeList(), + proto.google.v1.ValueType.toObject, includeInstance), + sampleList: jspb.Message.toObjectList(msg.getSampleList(), + proto.google.v1.Sample.toObject, includeInstance), + mappingList: jspb.Message.toObjectList(msg.getMappingList(), + proto.google.v1.Mapping.toObject, includeInstance), + locationList: jspb.Message.toObjectList(msg.getLocationList(), + proto.google.v1.Location.toObject, includeInstance), + functionList: jspb.Message.toObjectList(msg.getFunctionList(), + proto.google.v1.Function.toObject, includeInstance), + stringTableList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, + dropFrames: jspb.Message.getFieldWithDefault(msg, 7, 0), + keepFrames: jspb.Message.getFieldWithDefault(msg, 8, 0), + timeNanos: jspb.Message.getFieldWithDefault(msg, 9, 0), + durationNanos: jspb.Message.getFieldWithDefault(msg, 10, 0), + periodType: (f = msg.getPeriodType()) && proto.google.v1.ValueType.toObject(includeInstance, f), + period: jspb.Message.getFieldWithDefault(msg, 12, 0), + commentList: (f = jspb.Message.getRepeatedField(msg, 13)) == null ? undefined : f, + defaultSampleType: jspb.Message.getFieldWithDefault(msg, 14, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.google.v1.Profile} + */ +proto.google.v1.Profile.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.google.v1.Profile; + return proto.google.v1.Profile.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.google.v1.Profile} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.google.v1.Profile} + */ +proto.google.v1.Profile.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.google.v1.ValueType; + reader.readMessage(value,proto.google.v1.ValueType.deserializeBinaryFromReader); + msg.addSampleType(value); + break; + case 2: + var value = new proto.google.v1.Sample; + reader.readMessage(value,proto.google.v1.Sample.deserializeBinaryFromReader); + msg.addSample(value); + break; + case 3: + var value = new proto.google.v1.Mapping; + reader.readMessage(value,proto.google.v1.Mapping.deserializeBinaryFromReader); + msg.addMapping(value); + break; + case 4: + var value = new proto.google.v1.Location; + reader.readMessage(value,proto.google.v1.Location.deserializeBinaryFromReader); + msg.addLocation(value); + break; + case 5: + var value = new proto.google.v1.Function; + reader.readMessage(value,proto.google.v1.Function.deserializeBinaryFromReader); + msg.addFunction(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.addStringTable(value); + break; + case 7: + var value = /** @type {number} */ (reader.readInt64()); + msg.setDropFrames(value); + break; + case 8: + var value = /** @type {number} */ (reader.readInt64()); + msg.setKeepFrames(value); + break; + case 9: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimeNanos(value); + break; + case 10: + var value = /** @type {number} */ (reader.readInt64()); + msg.setDurationNanos(value); + break; + case 11: + var value = new proto.google.v1.ValueType; + reader.readMessage(value,proto.google.v1.ValueType.deserializeBinaryFromReader); + msg.setPeriodType(value); + break; + case 12: + var value = /** @type {number} */ (reader.readInt64()); + msg.setPeriod(value); + break; + case 13: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt64() : [reader.readInt64()]); + for (var i = 0; i < values.length; i++) { + msg.addComment(values[i]); + } + break; + case 14: + var value = /** @type {number} */ (reader.readInt64()); + msg.setDefaultSampleType(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.google.v1.Profile.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.google.v1.Profile.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.google.v1.Profile} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Profile.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSampleTypeList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.google.v1.ValueType.serializeBinaryToWriter + ); + } + f = message.getSampleList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.google.v1.Sample.serializeBinaryToWriter + ); + } + f = message.getMappingList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.google.v1.Mapping.serializeBinaryToWriter + ); + } + f = message.getLocationList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.google.v1.Location.serializeBinaryToWriter + ); + } + f = message.getFunctionList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.google.v1.Function.serializeBinaryToWriter + ); + } + f = message.getStringTableList(); + if (f.length > 0) { + writer.writeRepeatedString( + 6, + f + ); + } + f = message.getDropFrames(); + if (f !== 0) { + writer.writeInt64( + 7, + f + ); + } + f = message.getKeepFrames(); + if (f !== 0) { + writer.writeInt64( + 8, + f + ); + } + f = message.getTimeNanos(); + if (f !== 0) { + writer.writeInt64( + 9, + f + ); + } + f = message.getDurationNanos(); + if (f !== 0) { + writer.writeInt64( + 10, + f + ); + } + f = message.getPeriodType(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.google.v1.ValueType.serializeBinaryToWriter + ); + } + f = message.getPeriod(); + if (f !== 0) { + writer.writeInt64( + 12, + f + ); + } + f = message.getCommentList(); + if (f.length > 0) { + writer.writePackedInt64( + 13, + f + ); + } + f = message.getDefaultSampleType(); + if (f !== 0) { + writer.writeInt64( + 14, + f + ); + } +}; + + +/** + * repeated ValueType sample_type = 1; + * @return {!Array} + */ +proto.google.v1.Profile.prototype.getSampleTypeList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.google.v1.ValueType, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.v1.Profile} returns this +*/ +proto.google.v1.Profile.prototype.setSampleTypeList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.google.v1.ValueType=} opt_value + * @param {number=} opt_index + * @return {!proto.google.v1.ValueType} + */ +proto.google.v1.Profile.prototype.addSampleType = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.google.v1.ValueType, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.clearSampleTypeList = function() { + return this.setSampleTypeList([]); +}; + + +/** + * repeated Sample sample = 2; + * @return {!Array} + */ +proto.google.v1.Profile.prototype.getSampleList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.google.v1.Sample, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.v1.Profile} returns this +*/ +proto.google.v1.Profile.prototype.setSampleList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.google.v1.Sample=} opt_value + * @param {number=} opt_index + * @return {!proto.google.v1.Sample} + */ +proto.google.v1.Profile.prototype.addSample = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.google.v1.Sample, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.clearSampleList = function() { + return this.setSampleList([]); +}; + + +/** + * repeated Mapping mapping = 3; + * @return {!Array} + */ +proto.google.v1.Profile.prototype.getMappingList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.google.v1.Mapping, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.v1.Profile} returns this +*/ +proto.google.v1.Profile.prototype.setMappingList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.google.v1.Mapping=} opt_value + * @param {number=} opt_index + * @return {!proto.google.v1.Mapping} + */ +proto.google.v1.Profile.prototype.addMapping = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.v1.Mapping, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.clearMappingList = function() { + return this.setMappingList([]); +}; + + +/** + * repeated Location location = 4; + * @return {!Array} + */ +proto.google.v1.Profile.prototype.getLocationList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.google.v1.Location, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.v1.Profile} returns this +*/ +proto.google.v1.Profile.prototype.setLocationList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.google.v1.Location=} opt_value + * @param {number=} opt_index + * @return {!proto.google.v1.Location} + */ +proto.google.v1.Profile.prototype.addLocation = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.google.v1.Location, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.clearLocationList = function() { + return this.setLocationList([]); +}; + + +/** + * repeated Function function = 5; + * @return {!Array} + */ +proto.google.v1.Profile.prototype.getFunctionList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.google.v1.Function, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.v1.Profile} returns this +*/ +proto.google.v1.Profile.prototype.setFunctionList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.google.v1.Function=} opt_value + * @param {number=} opt_index + * @return {!proto.google.v1.Function} + */ +proto.google.v1.Profile.prototype.addFunction = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.google.v1.Function, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.clearFunctionList = function() { + return this.setFunctionList([]); +}; + + +/** + * repeated string string_table = 6; + * @return {!Array} + */ +proto.google.v1.Profile.prototype.getStringTableList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.setStringTableList = function(value) { + return jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.addStringTable = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.clearStringTableList = function() { + return this.setStringTableList([]); +}; + + +/** + * optional int64 drop_frames = 7; + * @return {number} + */ +proto.google.v1.Profile.prototype.getDropFrames = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.setDropFrames = function(value) { + return jspb.Message.setProto3IntField(this, 7, value); +}; + + +/** + * optional int64 keep_frames = 8; + * @return {number} + */ +proto.google.v1.Profile.prototype.getKeepFrames = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.setKeepFrames = function(value) { + return jspb.Message.setProto3IntField(this, 8, value); +}; + + +/** + * optional int64 time_nanos = 9; + * @return {number} + */ +proto.google.v1.Profile.prototype.getTimeNanos = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.setTimeNanos = function(value) { + return jspb.Message.setProto3IntField(this, 9, value); +}; + + +/** + * optional int64 duration_nanos = 10; + * @return {number} + */ +proto.google.v1.Profile.prototype.getDurationNanos = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.setDurationNanos = function(value) { + return jspb.Message.setProto3IntField(this, 10, value); +}; + + +/** + * optional ValueType period_type = 11; + * @return {?proto.google.v1.ValueType} + */ +proto.google.v1.Profile.prototype.getPeriodType = function() { + return /** @type{?proto.google.v1.ValueType} */ ( + jspb.Message.getWrapperField(this, proto.google.v1.ValueType, 11)); +}; + + +/** + * @param {?proto.google.v1.ValueType|undefined} value + * @return {!proto.google.v1.Profile} returns this +*/ +proto.google.v1.Profile.prototype.setPeriodType = function(value) { + return jspb.Message.setWrapperField(this, 11, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.clearPeriodType = function() { + return this.setPeriodType(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.google.v1.Profile.prototype.hasPeriodType = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * optional int64 period = 12; + * @return {number} + */ +proto.google.v1.Profile.prototype.getPeriod = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.setPeriod = function(value) { + return jspb.Message.setProto3IntField(this, 12, value); +}; + + +/** + * repeated int64 comment = 13; + * @return {!Array} + */ +proto.google.v1.Profile.prototype.getCommentList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 13)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.setCommentList = function(value) { + return jspb.Message.setField(this, 13, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.addComment = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 13, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.clearCommentList = function() { + return this.setCommentList([]); +}; + + +/** + * optional int64 default_sample_type = 14; + * @return {number} + */ +proto.google.v1.Profile.prototype.getDefaultSampleType = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 14, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Profile} returns this + */ +proto.google.v1.Profile.prototype.setDefaultSampleType = function(value) { + return jspb.Message.setProto3IntField(this, 14, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.google.v1.ValueType.prototype.toObject = function(opt_includeInstance) { + return proto.google.v1.ValueType.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.google.v1.ValueType} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.ValueType.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + unit: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.google.v1.ValueType} + */ +proto.google.v1.ValueType.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.google.v1.ValueType; + return proto.google.v1.ValueType.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.google.v1.ValueType} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.google.v1.ValueType} + */ +proto.google.v1.ValueType.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setType(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setUnit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.google.v1.ValueType.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.google.v1.ValueType.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.google.v1.ValueType} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.ValueType.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getUnit(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional int64 type = 1; + * @return {number} + */ +proto.google.v1.ValueType.prototype.getType = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.ValueType} returns this + */ +proto.google.v1.ValueType.prototype.setType = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 unit = 2; + * @return {number} + */ +proto.google.v1.ValueType.prototype.getUnit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.ValueType} returns this + */ +proto.google.v1.ValueType.prototype.setUnit = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.google.v1.Sample.repeatedFields_ = [1,2,3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.google.v1.Sample.prototype.toObject = function(opt_includeInstance) { + return proto.google.v1.Sample.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.google.v1.Sample} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Sample.toObject = function(includeInstance, msg) { + var f, obj = { + locationIdList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + valueList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + labelList: jspb.Message.toObjectList(msg.getLabelList(), + proto.google.v1.Label.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.google.v1.Sample} + */ +proto.google.v1.Sample.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.google.v1.Sample; + return proto.google.v1.Sample.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.google.v1.Sample} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.google.v1.Sample} + */ +proto.google.v1.Sample.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint64() : [reader.readUint64()]); + for (var i = 0; i < values.length; i++) { + msg.addLocationId(values[i]); + } + break; + case 2: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt64() : [reader.readInt64()]); + for (var i = 0; i < values.length; i++) { + msg.addValue(values[i]); + } + break; + case 3: + var value = new proto.google.v1.Label; + reader.readMessage(value,proto.google.v1.Label.deserializeBinaryFromReader); + msg.addLabel(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.google.v1.Sample.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.google.v1.Sample.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.google.v1.Sample} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Sample.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLocationIdList(); + if (f.length > 0) { + writer.writePackedUint64( + 1, + f + ); + } + f = message.getValueList(); + if (f.length > 0) { + writer.writePackedInt64( + 2, + f + ); + } + f = message.getLabelList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.google.v1.Label.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated uint64 location_id = 1; + * @return {!Array} + */ +proto.google.v1.Sample.prototype.getLocationIdList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.v1.Sample} returns this + */ +proto.google.v1.Sample.prototype.setLocationIdList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.google.v1.Sample} returns this + */ +proto.google.v1.Sample.prototype.addLocationId = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.v1.Sample} returns this + */ +proto.google.v1.Sample.prototype.clearLocationIdList = function() { + return this.setLocationIdList([]); +}; + + +/** + * repeated int64 value = 2; + * @return {!Array} + */ +proto.google.v1.Sample.prototype.getValueList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.v1.Sample} returns this + */ +proto.google.v1.Sample.prototype.setValueList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.google.v1.Sample} returns this + */ +proto.google.v1.Sample.prototype.addValue = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.v1.Sample} returns this + */ +proto.google.v1.Sample.prototype.clearValueList = function() { + return this.setValueList([]); +}; + + +/** + * repeated Label label = 3; + * @return {!Array} + */ +proto.google.v1.Sample.prototype.getLabelList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.google.v1.Label, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.v1.Sample} returns this +*/ +proto.google.v1.Sample.prototype.setLabelList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.google.v1.Label=} opt_value + * @param {number=} opt_index + * @return {!proto.google.v1.Label} + */ +proto.google.v1.Sample.prototype.addLabel = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.v1.Label, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.v1.Sample} returns this + */ +proto.google.v1.Sample.prototype.clearLabelList = function() { + return this.setLabelList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.google.v1.Label.prototype.toObject = function(opt_includeInstance) { + return proto.google.v1.Label.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.google.v1.Label} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Label.toObject = function(includeInstance, msg) { + var f, obj = { + key: jspb.Message.getFieldWithDefault(msg, 1, 0), + str: jspb.Message.getFieldWithDefault(msg, 2, 0), + num: jspb.Message.getFieldWithDefault(msg, 3, 0), + numUnit: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.google.v1.Label} + */ +proto.google.v1.Label.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.google.v1.Label; + return proto.google.v1.Label.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.google.v1.Label} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.google.v1.Label} + */ +proto.google.v1.Label.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setKey(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStr(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNum(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNumUnit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.google.v1.Label.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.google.v1.Label.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.google.v1.Label} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Label.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getStr(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getNum(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getNumUnit(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * optional int64 key = 1; + * @return {number} + */ +proto.google.v1.Label.prototype.getKey = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Label} returns this + */ +proto.google.v1.Label.prototype.setKey = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 str = 2; + * @return {number} + */ +proto.google.v1.Label.prototype.getStr = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Label} returns this + */ +proto.google.v1.Label.prototype.setStr = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 num = 3; + * @return {number} + */ +proto.google.v1.Label.prototype.getNum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Label} returns this + */ +proto.google.v1.Label.prototype.setNum = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 num_unit = 4; + * @return {number} + */ +proto.google.v1.Label.prototype.getNumUnit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Label} returns this + */ +proto.google.v1.Label.prototype.setNumUnit = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.google.v1.Mapping.prototype.toObject = function(opt_includeInstance) { + return proto.google.v1.Mapping.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.google.v1.Mapping} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Mapping.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, 0), + memoryStart: jspb.Message.getFieldWithDefault(msg, 2, 0), + memoryLimit: jspb.Message.getFieldWithDefault(msg, 3, 0), + fileOffset: jspb.Message.getFieldWithDefault(msg, 4, 0), + filename: jspb.Message.getFieldWithDefault(msg, 5, 0), + buildId: jspb.Message.getFieldWithDefault(msg, 6, 0), + hasFunctions: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), + hasFilenames: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), + hasLineNumbers: jspb.Message.getBooleanFieldWithDefault(msg, 9, false), + hasInlineFrames: jspb.Message.getBooleanFieldWithDefault(msg, 10, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.google.v1.Mapping} + */ +proto.google.v1.Mapping.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.google.v1.Mapping; + return proto.google.v1.Mapping.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.google.v1.Mapping} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.google.v1.Mapping} + */ +proto.google.v1.Mapping.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setMemoryStart(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setMemoryLimit(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint64()); + msg.setFileOffset(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFilename(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt64()); + msg.setBuildId(value); + break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasFunctions(value); + break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasFilenames(value); + break; + case 9: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasLineNumbers(value); + break; + case 10: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasInlineFrames(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.google.v1.Mapping.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.google.v1.Mapping.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.google.v1.Mapping} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Mapping.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getMemoryStart(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } + f = message.getMemoryLimit(); + if (f !== 0) { + writer.writeUint64( + 3, + f + ); + } + f = message.getFileOffset(); + if (f !== 0) { + writer.writeUint64( + 4, + f + ); + } + f = message.getFilename(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } + f = message.getBuildId(); + if (f !== 0) { + writer.writeInt64( + 6, + f + ); + } + f = message.getHasFunctions(); + if (f) { + writer.writeBool( + 7, + f + ); + } + f = message.getHasFilenames(); + if (f) { + writer.writeBool( + 8, + f + ); + } + f = message.getHasLineNumbers(); + if (f) { + writer.writeBool( + 9, + f + ); + } + f = message.getHasInlineFrames(); + if (f) { + writer.writeBool( + 10, + f + ); + } +}; + + +/** + * optional uint64 id = 1; + * @return {number} + */ +proto.google.v1.Mapping.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Mapping} returns this + */ +proto.google.v1.Mapping.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint64 memory_start = 2; + * @return {number} + */ +proto.google.v1.Mapping.prototype.getMemoryStart = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Mapping} returns this + */ +proto.google.v1.Mapping.prototype.setMemoryStart = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional uint64 memory_limit = 3; + * @return {number} + */ +proto.google.v1.Mapping.prototype.getMemoryLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Mapping} returns this + */ +proto.google.v1.Mapping.prototype.setMemoryLimit = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional uint64 file_offset = 4; + * @return {number} + */ +proto.google.v1.Mapping.prototype.getFileOffset = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Mapping} returns this + */ +proto.google.v1.Mapping.prototype.setFileOffset = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional int64 filename = 5; + * @return {number} + */ +proto.google.v1.Mapping.prototype.getFilename = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Mapping} returns this + */ +proto.google.v1.Mapping.prototype.setFilename = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + +/** + * optional int64 build_id = 6; + * @return {number} + */ +proto.google.v1.Mapping.prototype.getBuildId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Mapping} returns this + */ +proto.google.v1.Mapping.prototype.setBuildId = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); +}; + + +/** + * optional bool has_functions = 7; + * @return {boolean} + */ +proto.google.v1.Mapping.prototype.getHasFunctions = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.google.v1.Mapping} returns this + */ +proto.google.v1.Mapping.prototype.setHasFunctions = function(value) { + return jspb.Message.setProto3BooleanField(this, 7, value); +}; + + +/** + * optional bool has_filenames = 8; + * @return {boolean} + */ +proto.google.v1.Mapping.prototype.getHasFilenames = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.google.v1.Mapping} returns this + */ +proto.google.v1.Mapping.prototype.setHasFilenames = function(value) { + return jspb.Message.setProto3BooleanField(this, 8, value); +}; + + +/** + * optional bool has_line_numbers = 9; + * @return {boolean} + */ +proto.google.v1.Mapping.prototype.getHasLineNumbers = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.google.v1.Mapping} returns this + */ +proto.google.v1.Mapping.prototype.setHasLineNumbers = function(value) { + return jspb.Message.setProto3BooleanField(this, 9, value); +}; + + +/** + * optional bool has_inline_frames = 10; + * @return {boolean} + */ +proto.google.v1.Mapping.prototype.getHasInlineFrames = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.google.v1.Mapping} returns this + */ +proto.google.v1.Mapping.prototype.setHasInlineFrames = function(value) { + return jspb.Message.setProto3BooleanField(this, 10, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.google.v1.Location.repeatedFields_ = [4]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.google.v1.Location.prototype.toObject = function(opt_includeInstance) { + return proto.google.v1.Location.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.google.v1.Location} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Location.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, 0), + mappingId: jspb.Message.getFieldWithDefault(msg, 2, 0), + address: jspb.Message.getFieldWithDefault(msg, 3, 0), + lineList: jspb.Message.toObjectList(msg.getLineList(), + proto.google.v1.Line.toObject, includeInstance), + isFolded: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.google.v1.Location} + */ +proto.google.v1.Location.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.google.v1.Location; + return proto.google.v1.Location.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.google.v1.Location} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.google.v1.Location} + */ +proto.google.v1.Location.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setMappingId(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setAddress(value); + break; + case 4: + var value = new proto.google.v1.Line; + reader.readMessage(value,proto.google.v1.Line.deserializeBinaryFromReader); + msg.addLine(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsFolded(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.google.v1.Location.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.google.v1.Location.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.google.v1.Location} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Location.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getMappingId(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } + f = message.getAddress(); + if (f !== 0) { + writer.writeUint64( + 3, + f + ); + } + f = message.getLineList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.google.v1.Line.serializeBinaryToWriter + ); + } + f = message.getIsFolded(); + if (f) { + writer.writeBool( + 5, + f + ); + } +}; + + +/** + * optional uint64 id = 1; + * @return {number} + */ +proto.google.v1.Location.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Location} returns this + */ +proto.google.v1.Location.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint64 mapping_id = 2; + * @return {number} + */ +proto.google.v1.Location.prototype.getMappingId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Location} returns this + */ +proto.google.v1.Location.prototype.setMappingId = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional uint64 address = 3; + * @return {number} + */ +proto.google.v1.Location.prototype.getAddress = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Location} returns this + */ +proto.google.v1.Location.prototype.setAddress = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * repeated Line line = 4; + * @return {!Array} + */ +proto.google.v1.Location.prototype.getLineList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.google.v1.Line, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.google.v1.Location} returns this +*/ +proto.google.v1.Location.prototype.setLineList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.google.v1.Line=} opt_value + * @param {number=} opt_index + * @return {!proto.google.v1.Line} + */ +proto.google.v1.Location.prototype.addLine = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.google.v1.Line, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.google.v1.Location} returns this + */ +proto.google.v1.Location.prototype.clearLineList = function() { + return this.setLineList([]); +}; + + +/** + * optional bool is_folded = 5; + * @return {boolean} + */ +proto.google.v1.Location.prototype.getIsFolded = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.google.v1.Location} returns this + */ +proto.google.v1.Location.prototype.setIsFolded = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.google.v1.Line.prototype.toObject = function(opt_includeInstance) { + return proto.google.v1.Line.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.google.v1.Line} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Line.toObject = function(includeInstance, msg) { + var f, obj = { + functionId: jspb.Message.getFieldWithDefault(msg, 1, 0), + line: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.google.v1.Line} + */ +proto.google.v1.Line.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.google.v1.Line; + return proto.google.v1.Line.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.google.v1.Line} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.google.v1.Line} + */ +proto.google.v1.Line.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setFunctionId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLine(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.google.v1.Line.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.google.v1.Line.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.google.v1.Line} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Line.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFunctionId(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getLine(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional uint64 function_id = 1; + * @return {number} + */ +proto.google.v1.Line.prototype.getFunctionId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Line} returns this + */ +proto.google.v1.Line.prototype.setFunctionId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 line = 2; + * @return {number} + */ +proto.google.v1.Line.prototype.getLine = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Line} returns this + */ +proto.google.v1.Line.prototype.setLine = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.google.v1.Function.prototype.toObject = function(opt_includeInstance) { + return proto.google.v1.Function.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.google.v1.Function} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Function.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, 0), + name: jspb.Message.getFieldWithDefault(msg, 2, 0), + systemName: jspb.Message.getFieldWithDefault(msg, 3, 0), + filename: jspb.Message.getFieldWithDefault(msg, 4, 0), + startLine: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.google.v1.Function} + */ +proto.google.v1.Function.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.google.v1.Function; + return proto.google.v1.Function.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.google.v1.Function} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.google.v1.Function} + */ +proto.google.v1.Function.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setName(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setSystemName(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFilename(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStartLine(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.google.v1.Function.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.google.v1.Function.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.google.v1.Function} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.google.v1.Function.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getName(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getSystemName(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getFilename(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getStartLine(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } +}; + + +/** + * optional uint64 id = 1; + * @return {number} + */ +proto.google.v1.Function.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Function} returns this + */ +proto.google.v1.Function.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 name = 2; + * @return {number} + */ +proto.google.v1.Function.prototype.getName = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Function} returns this + */ +proto.google.v1.Function.prototype.setName = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 system_name = 3; + * @return {number} + */ +proto.google.v1.Function.prototype.getSystemName = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Function} returns this + */ +proto.google.v1.Function.prototype.setSystemName = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 filename = 4; + * @return {number} + */ +proto.google.v1.Function.prototype.getFilename = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Function} returns this + */ +proto.google.v1.Function.prototype.setFilename = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional int64 start_line = 5; + * @return {number} + */ +proto.google.v1.Function.prototype.getStartLine = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.google.v1.Function} returns this + */ +proto.google.v1.Function.prototype.setStartLine = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + +goog.object.extend(exports, proto.google.v1); diff --git a/pyroscope/proto/google/v1/profile.proto b/pyroscope/proto/google/v1/profile.proto new file mode 100644 index 00000000..5c794488 --- /dev/null +++ b/pyroscope/proto/google/v1/profile.proto @@ -0,0 +1,212 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Profile is a common stacktrace profile format. +// +// Measurements represented with this format should follow the +// following conventions: +// +// - Consumers should treat unset optional fields as if they had been +// set with their default value. +// +// - When possible, measurements should be stored in "unsampled" form +// that is most useful to humans. There should be enough +// information present to determine the original sampled values. +// +// - On-disk, the serialized proto must be gzip-compressed. +// +// - The profile is represented as a set of samples, where each sample +// references a sequence of locations, and where each location belongs +// to a mapping. +// - There is a N->1 relationship from sample.location_id entries to +// locations. For every sample.location_id entry there must be a +// unique Location with that id. +// - There is an optional N->1 relationship from locations to +// mappings. For every nonzero Location.mapping_id there must be a +// unique Mapping with that id. + +syntax = "proto3"; + +package google.v1; + +option java_outer_classname = "ProfileProto"; +option java_package = "com.google.perftools.profiles"; + +message Profile { + // A description of the samples associated with each Sample.value. + // For a cpu profile this might be: + // [["cpu","nanoseconds"]] or [["wall","seconds"]] or [["syscall","count"]] + // For a heap profile, this might be: + // [["allocations","count"], ["space","bytes"]], + // If one of the values represents the number of events represented + // by the sample, by convention it should be at index 0 and use + // sample_type.unit == "count". + repeated ValueType sample_type = 1; + // The set of samples recorded in this profile. + repeated Sample sample = 2; + // Mapping from address ranges to the image/binary/library mapped + // into that address range. mapping[0] will be the main binary. + repeated Mapping mapping = 3; + // Useful program location + repeated Location location = 4; + // Functions referenced by locations + repeated Function function = 5; + // A common table for strings referenced by various messages. + // string_table[0] must always be "". + repeated string string_table = 6; + // frames with Function.function_name fully matching the following + // regexp will be dropped from the samples, along with their successors. + int64 drop_frames = 7; // Index into string table. + // frames with Function.function_name fully matching the following + // regexp will be kept, even if it matches drop_frames. + int64 keep_frames = 8; // Index into string table. + + // The following fields are informational, do not affect + // interpretation of results. + + // Time of collection (UTC) represented as nanoseconds past the epoch. + int64 time_nanos = 9; + // Duration of the profile, if a duration makes sense. + int64 duration_nanos = 10; + // The kind of events between sampled ocurrences. + // e.g [ "cpu","cycles" ] or [ "heap","bytes" ] + ValueType period_type = 11; + // The number of events between sampled occurrences. + int64 period = 12; + // Freeform text associated to the profile. + repeated int64 comment = 13; // Indices into string table. + // Index into the string table of the type of the preferred sample + // value. If unset, clients should default to the last sample value. + int64 default_sample_type = 14; +} + +// ValueType describes the semantics and measurement units of a value. +message ValueType { + int64 type = 1; // Index into string table. + int64 unit = 2; // Index into string table. +} + +// Each Sample records values encountered in some program +// context. The program context is typically a stack trace, perhaps +// augmented with auxiliary information like the thread-id, some +// indicator of a higher level request being handled etc. +message Sample { + // The ids recorded here correspond to a Profile.location.id. + // The leaf is at location_id[0]. + repeated uint64 location_id = 1; + // The type and unit of each value is defined by the corresponding + // entry in Profile.sample_type. All samples must have the same + // number of values, the same as the length of Profile.sample_type. + // When aggregating multiple samples into a single sample, the + // result has a list of values that is the element-wise sum of the + // lists of the originals. + repeated int64 value = 2; + // label includes additional context for this sample. It can include + // things like a thread id, allocation size, etc + repeated Label label = 3; +} + +message Label { + int64 key = 1; // Index into string table + + // At most one of the following must be present + int64 str = 2; // Index into string table + int64 num = 3; + + // Should only be present when num is present. + // Specifies the units of num. + // Use arbitrary string (for example, "requests") as a custom count unit. + // If no unit is specified, consumer may apply heuristic to deduce the unit. + // Consumers may also interpret units like "bytes" and "kilobytes" as memory + // units and units like "seconds" and "nanoseconds" as time units, + // and apply appropriate unit conversions to these. + int64 num_unit = 4; // Index into string table +} + +message Mapping { + // Unique nonzero id for the mapping. + uint64 id = 1; + // Address at which the binary (or DLL) is loaded into memory. + uint64 memory_start = 2; + // The limit of the address range occupied by this mapping. + uint64 memory_limit = 3; + // Offset in the binary that corresponds to the first mapped address. + uint64 file_offset = 4; + // The object this entry is loaded from. This can be a filename on + // disk for the main binary and shared libraries, or virtual + // abstractions like "[vdso]". + int64 filename = 5; // Index into string table + // A string that uniquely identifies a particular program version + // with high probability. E.g., for binaries generated by GNU tools, + // it could be the contents of the .note.gnu.build-id field. + int64 build_id = 6; // Index into string table + + // The following fields indicate the resolution of symbolic info. + bool has_functions = 7; + bool has_filenames = 8; + bool has_line_numbers = 9; + bool has_inline_frames = 10; +} + +// Describes function and line table debug information. +message Location { + // Unique nonzero id for the location. A profile could use + // instruction addresses or any integer sequence as ids. + uint64 id = 1; + // The id of the corresponding profile.Mapping for this location. + // It can be unset if the mapping is unknown or not applicable for + // this profile type. + uint64 mapping_id = 2; + // The instruction address for this location, if available. It + // should be within [Mapping.memory_start...Mapping.memory_limit] + // for the corresponding mapping. A non-leaf address may be in the + // middle of a call instruction. It is up to display tools to find + // the beginning of the instruction if necessary. + uint64 address = 3; + // Multiple line indicates this location has inlined functions, + // where the last entry represents the caller into which the + // preceding entries were inlined. + // + // E.g., if memcpy() is inlined into printf: + // line[0].function_name == "memcpy" + // line[1].function_name == "printf" + repeated Line line = 4; + // Provides an indication that multiple symbols map to this location's + // address, for example due to identical code folding by the linker. In that + // case the line information above represents one of the multiple + // symbols. This field must be recomputed when the symbolization state of the + // profile changes. + bool is_folded = 5; +} + +message Line { + // The id of the corresponding profile.Function for this line. + uint64 function_id = 1; + // Line number in source code. + int64 line = 2; +} + +message Function { + // Unique nonzero id for the function. + uint64 id = 1; + // Name of the function, in human-readable form if available. + int64 name = 2; // Index into string table + // Name of the function, as identified by the system. + // For instance, it can be a C++ mangled name. + int64 system_name = 3; // Index into string table + // Source file containing the function. + int64 filename = 4; // Index into string table + // Line number in source file. + int64 start_line = 5; +} diff --git a/pyroscope/proto/querier.proto b/pyroscope/proto/querier.proto new file mode 100644 index 00000000..f5fc7fc5 --- /dev/null +++ b/pyroscope/proto/querier.proto @@ -0,0 +1,133 @@ +syntax = "proto3"; + +package querier.v1; + +import "google/v1/profile.proto"; +import "types/v1/types.proto"; + +service QuerierService { + // ProfileType returns a list of the existing profile types. + rpc ProfileTypes(ProfileTypesRequest) returns (ProfileTypesResponse) {} + // LabelValues returns the existing label values for the provided label names. + rpc LabelValues(types.v1.LabelValuesRequest) returns (types.v1.LabelValuesResponse) {} + // LabelNames returns a list of the existing label names. + rpc LabelNames(types.v1.LabelNamesRequest) returns (types.v1.LabelNamesResponse) {} + // Series returns profiles series matching the request. A series is a unique label set. + rpc Series(SeriesRequest) returns (SeriesResponse) {} + // SelectMergeStacktraces returns matching profiles aggregated in a flamegraph format. It will combine samples from within the same callstack, with each element being grouped by its function name. + rpc SelectMergeStacktraces(SelectMergeStacktracesRequest) returns (SelectMergeStacktracesResponse) {} + // SelectMergeSpans returns matching profiles aggregated in a flamegraph format. It will combine samples from within the same callstack, with each element being grouped by its function name. + rpc SelectMergeSpanProfile(SelectMergeSpanProfileRequest) returns (SelectMergeSpanProfileResponse) {} + // SelectMergeProfile returns matching profiles aggregated in pprof format. It will contain all information stored (so including filenames and line number, if ingested). + rpc SelectMergeProfile(SelectMergeProfileRequest) returns (google.v1.Profile) {} + // SelectSeries returns a time series for the total sum of the requested profiles. + rpc SelectSeries(SelectSeriesRequest) returns (SelectSeriesResponse) {} + + rpc Diff(DiffRequest) returns (DiffResponse) {} +} + +message ProfileTypesRequest { + // Milliseconds since epoch. If missing or zero, only the ingesters will be + // queried. + int64 start = 1; + // Milliseconds since epoch. If missing or zero, only the ingesters will be + // queried. + int64 end = 2; +} + +message ProfileTypesResponse { + repeated types.v1.ProfileType profile_types = 1; +} + +message SeriesRequest { + repeated string matchers = 1; + repeated string label_names = 2; + // Milliseconds since epoch. If missing or zero, only the ingesters will be + // queried. + int64 start = 3; + // Milliseconds since epoch. If missing or zero, only the ingesters will be + // queried. + int64 end = 4; +} + +message SeriesResponse { + repeated types.v1.Labels labels_set = 2; +} + +message SelectMergeStacktracesRequest { + string profile_typeID = 1; + string label_selector = 2; + int64 start = 3; // milliseconds since epoch + int64 end = 4; // milliseconds since epoch + optional int64 max_nodes = 5; // Limit the nodes returned to only show the node with the max_node's biggest total +} + +message SelectMergeStacktracesResponse { + FlameGraph flamegraph = 1; +} + +message SelectMergeSpanProfileRequest { + string profile_typeID = 1; + string label_selector = 2; + repeated string span_selector = 3; + int64 start = 4; // milliseconds since epoch + int64 end = 5; // milliseconds since epoch + optional int64 max_nodes = 6; // Limit the nodes returned to only show the node with the max_node's biggest total +} + +message SelectMergeSpanProfileResponse { + FlameGraph flamegraph = 1; +} + +message DiffRequest { + SelectMergeStacktracesRequest left = 1; + SelectMergeStacktracesRequest right = 2; +} + +message DiffResponse { + FlameGraphDiff flamegraph = 1; +} + +message FlameGraph { + repeated string names = 1; + repeated Level levels = 2; + int64 total = 3; + int64 max_self = 4; +} + +message FlameGraphDiff { + repeated string names = 1; + repeated Level levels = 2; + int64 total = 3; + int64 max_self = 4; + + int64 leftTicks = 5; + int64 rightTicks = 6; +} + +message Level { + repeated int64 values = 1; +} + +message SelectMergeProfileRequest { + string profile_typeID = 1; + string label_selector = 2; + int64 start = 3; // milliseconds since epoch + int64 end = 4; // milliseconds since epoch + optional int64 max_nodes = 5; // Limit the nodes returned to only show the node with the max_node's biggest total + optional types.v1.StackTraceSelector stack_trace_selector = 6; // Only return stack traces matching the selector +} + +message SelectSeriesRequest { + string profile_typeID = 1; + string label_selector = 2; + int64 start = 3; // milliseconds since epoch + int64 end = 4; // milliseconds since epoch + repeated string group_by = 5; + double step = 6; // Query resolution step width in seconds + optional types.v1.TimeSeriesAggregationType aggregation = 7; +} + +message SelectSeriesResponse { + repeated types.v1.Series series = 1; +} diff --git a/pyroscope/proto/types/v1/types.proto b/pyroscope/proto/types/v1/types.proto new file mode 100644 index 00000000..62f8ec94 --- /dev/null +++ b/pyroscope/proto/types/v1/types.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; + +package types.v1; + +message LabelPair { + string name = 1; + string value = 2; +} + +message ProfileType { + string ID = 1; + string name = 2; + string sample_type = 4; + string sample_unit = 5; + string period_type = 6; + string period_unit = 7; +} + +message Labels { + // LabelPair is the key value pairs to identify the corresponding profile + repeated LabelPair labels = 1; +} + +message Series { + repeated LabelPair labels = 1; + repeated Point points = 2; +} + +message Point { + double value = 1; + // Milliseconds unix timestamp + int64 timestamp = 2; +} + +message LabelValuesRequest { + string name = 1; + repeated string matchers = 2; + int64 start = 3; + int64 end = 4; +} + +message LabelValuesResponse { + repeated string names = 1; +} + +message LabelNamesRequest { + repeated string matchers = 1; + int64 start = 2; + int64 end = 3; +} + +message LabelNamesResponse { + repeated string names = 1; +} + +message BlockInfo { + string ulid = 1; + int64 min_time = 2; + int64 max_time = 3; + BlockCompaction compaction = 4; + repeated LabelPair labels = 5; +} + +message BlockCompaction { + int32 level = 1; + repeated string sources = 2; + repeated string parents = 3; +} + +enum TimeSeriesAggregationType { + TIME_SERIES_AGGREGATION_TYPE_SUM = 0; + TIME_SERIES_AGGREGATION_TYPE_AVERAGE = 1; +} + +// StackTraceSelector is used for filtering stack traces by locations. +message StackTraceSelector { + // Only stack traces that have this stack trace as a prefix will be selected. + // If empty, no stack traces will be selected. Leaf is at stack_trace[0]. + repeated Location stack_trace = 1; +} + +message Location { + string name = 1; +} diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js index 3a24916a..2c5ba2ce 100644 --- a/pyroscope/pyroscope.js +++ b/pyroscope/pyroscope.js @@ -6,20 +6,11 @@ const { DATABASE_NAME } = require('../lib/utils') const Sql = require('@cloki/clickhouse-sql') const { pyroscopeSelectMergeStacktraces } = require('../wasm_parts/main') const compiler = require('../parser/bnf') -const { createFlameGraph, readULeb32 } = require('./pprof') -const pprofBin = require('./pprof-bin/pkg/pprof_bin') -const { QrynBadRequest } = require('../lib/handlers/errors') - -const HISTORY_TIMESPAN = 1000 * 60 * 60 * 24 * 7 const profileTypesHandler = async (req, res) => { const _res = new messages.ProfileTypesResponse() - const fromTimeSec = req.body && req.body.getStart - ? parseInt(req.body.getStart()) / 1000 - : (Date.now() - HISTORY_TIMESPAN) / 1000 - const toTimeSec = req.body && req.body.getEnd - ? parseInt(req.body.getEnd()) / 1000 - : Date.now() / 1000 + const fromTimeSec = req.body ? parseInt(req.body.getStart()) / 1000 : (Date.now() - 1000 * 60 * 60 * 48) / 1000 + const toTimeSec = req.body ? parseInt(req.body.getEnd()) / 1000 : Date.now() / 1000 const profileTypes = await clickhouse.rawRequest(`SELECT DISTINCT type_id, sample_type_unit FROM profiles_series ARRAY JOIN sample_types_units as sample_type_unit WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, @@ -35,33 +26,27 @@ WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDa pt.setPeriodUnit(periodUnit) return pt })) - return res.code(200).send(Buffer.from(_res.serializeBinary())) + return res.code(200).send(_res.serializeBinary()) } const labelNames = async (req, res) => { - const fromTimeSec = req.body && req.body.getStart - ? parseInt(req.body.getStart()) / 1000 - : (Date.now() - HISTORY_TIMESPAN) / 1000 - const toTimeSec = req.body && req.body.getEnd - ? parseInt(req.body.getEnd()) / 1000 - : Date.now() / 1000 + const fromTimeSec = req.body ? parseInt(req.body.getStart()) / 1000 : (Date.now() - 1000 * 60 * 60 * 48) / 1000 + const toTimeSec = req.body ? parseInt(req.body.getEnd()) / 1000 : Date.now() / 1000 const labelNames = await clickhouse.rawRequest(`SELECT DISTINCT key FROM profiles_series_keys WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, null, DATABASE_NAME()) const resp = new types.LabelNamesResponse() resp.setNamesList(labelNames.data.data.map(label => label.key)) - return res.code(200).send(Buffer.from(resp.serializeBinary())) + return res.code(200).send(resp.serializeBinary()) } const labelValues = async (req, res) => { - const name = req.body && req.body.getName - ? req.body.getName() - : '' - const fromTimeSec = req.body && req.body.getStart && req.body.getStart() + const name = req.body ? req.body.getName() : '' + const fromTimeSec = req.body && req.body.getStart() ? parseInt(req.body.getStart()) / 1000 - : (Date.now() - HISTORY_TIMESPAN) / 1000 - const toTimeSec = req.body && req.body.getEnd && req.body.getEnd() + : (Date.now() - 1000 * 60 * 60 * 48) / 1000 + const toTimeSec = req.body && req.body.getEnd() ? parseInt(req.body.getEnd()) / 1000 : Date.now() / 1000 if (!name) { @@ -74,7 +59,7 @@ date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, null, DATABASE_NAME()) const resp = new types.LabelValuesResponse() resp.setNamesList(labelValues.data.data.map(label => label.val)) - return res.code(200).send(Buffer.from(resp.serializeBinary())) + return res.code(200).send(resp.serializeBinary()) } const parser = (MsgClass) => { @@ -99,59 +84,17 @@ const parser = (MsgClass) => { } } -let ctxIdx = 0 - -/** - * - * @param {Sql.Select} query - * @param {string} labelSelector - */ -const labelSelectorQuery = (query, labelSelector) => { - if (!labelSelector || !labelSelector.length || labelSelector === '{}') { - return query - } - const labelSelectorScript = compiler.ParseScript(labelSelector).rootToken - const labelsConds = [] - for (const rule of labelSelectorScript.Children('log_stream_selector_rule')) { - const val = JSON.parse(rule.Child('quoted_str').value) - let valRul = null - switch (rule.Child('operator').value) { - case '=': - valRul = Sql.Eq(new Sql.Raw('val'), Sql.val(val)) - break - case '!=': - valRul = Sql.Ne(new Sql.Raw('val'), Sql.val(val)) - break - case '=~': - valRul = Sql.Eq(`match(val, ${Sql.quoteVal(val)})`, 1) - break - case '!~': - valRul = Sql.Ne(`match(val, ${Sql.quoteVal(val)})`, 1) - } - const labelSubCond = Sql.And( - Sql.Eq('key', Sql.val(rule.Child('label').value)), - valRul - ) - labelsConds.push(labelSubCond) - } - query.where(Sql.Or(...labelsConds)) - query.having(Sql.Eq( - new Sql.Raw(labelsConds.map((cond, i) => { - return `bitShiftLeft(toUInt64(${cond}), ${i})` - }).join('+')), - new Sql.Raw(`bitShiftLeft(toUInt64(1), ${labelsConds.length})-1`) - )) -} - const selectMergeStacktraces = async (req, res) => { + console.log(`selectMergeStacktraces ${req.body}`) const typeRe = req.body.getProfileTypeid().match(/^(.+):([^:]+):([^:]+)$/) const sel = req.body.getLabelSelector() const fromTimeSec = req.body && req.body.getStart() - ? Math.floor(parseInt(req.body.getStart()) / 1000) - : Math.floor((Date.now() - 1000 * 60 * 60 * 48) / 1000) + ? parseInt(req.body.getStart()) / 1000 + : (Date.now() - 1000 * 60 * 60 * 48) / 1000 const toTimeSec = req.body && req.body.getEnd() - ? Math.floor(parseInt(req.body.getEnd()) / 1000) - : Math.floor(Date.now() / 1000) + ? parseInt(req.body.getEnd()) / 1000 + : Date.now() / 1000 + const query = sel ? compiler.ParseScript(sel).rootToken : null; const idxSelect = (new Sql.Select()) .select('fingerprint') .from('profiles_series_gin') @@ -163,7 +106,24 @@ const selectMergeStacktraces = async (req, res) => { Sql.Lte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)}))`)) ) ).groupBy('fingerprint') - labelSelectorQuery(idxSelect, sel) + if (query) { + const labelsConds = [] + for (const rule of query.Children('log_stream_selector_rule')) { + const val = JSON.parse(rule.Child('quoted_str').value) + const labelSubCond = Sql.And( + Sql.Eq('key', Sql.val(rule.Child('label').value)), + Sql.Eq('val', Sql.val(val)) + ) + labelsConds.push(labelSubCond) + } + idxSelect.where(Sql.Or(...labelsConds)) + idxSelect.having(Sql.Eq( + new Sql.Raw(labelsConds.map((cond, i) => { + return `bitShiftLeft(toUInt64(${cond}), ${i})` + }).join('+')), + new Sql.Raw(`bitShiftLeft(toUInt64(1), ${labelsConds.length})-1`) + )) + } const sqlReq = (new Sql.Select()) .select('payload') .from('profiles') @@ -173,159 +133,48 @@ const selectMergeStacktraces = async (req, res) => { Sql.Lte('timestamp_ns', new Sql.Raw(Math.floor(toTimeSec) + '000000000')), new Sql.In('fingerprint', 'IN', idxSelect) )) + let start = Date.now() const profiles = await clickhouse.rawRequest(sqlReq.toString() + 'FORMAT RowBinary', null, DATABASE_NAME(), { responseType: 'arraybuffer' }) - const binData = Uint8Array.from(profiles.data) - require('./pprof-bin/pkg/pprof_bin').init_panic_hook() - const promises = [] - const _ctxIdx = ++ctxIdx - for (let i = 0; i < binData.length;) { - const [size, shift] = readULeb32(binData, i) - const uarray = Uint8Array.from(profiles.data.slice(i + shift, i + size + shift)) - i += size + shift - promises.push(new Promise((resolve, reject) => setTimeout(() => { - try { - pprofBin.merge_tree(_ctxIdx, uarray, `${typeRe[2]}:${typeRe[3]}`) - resolve() - } catch (e) { - reject(e) - } - }, 0))) - } - let sResp = null - try { - await Promise.all(promises) - sResp = pprofBin.export_tree(_ctxIdx) - } finally { - try { pprofBin.drop_tree(_ctxIdx) } catch (e) { req.log.error(e) } - } - return res.code(200).send(Buffer.from(sResp)) + console.log(`got ${profiles.data.length} bytes in ${Date.now() - start} ms`) + start = Date.now() + const _res = profiles.data.length !== 0 + ? pyroscopeSelectMergeStacktraces(Uint8Array.from(profiles.data)) + : { names: [], total: 0, maxSelf: 0, levels: [] } + console.log(`processed ${profiles.data.length} bytes in ${Date.now() - start} ms`) + const resp = new messages.SelectMergeStacktracesResponse() + const fg = new messages.FlameGraph() + fg.setNamesList(_res.names) + fg.setTotal(_res.total) + fg.setMaxSelf(_res.maxSelf) + fg.setLevelsList(_res.levels.map(l => { + const level = new messages.Level() + level.setValuesList(l) + return level + })) + resp.setFlamegraph(fg) + return res.code(200).send(resp.serializeBinary()) + /* +message SelectMergeStacktracesResponse { + FlameGraph flamegraph = 1; +} +message FlameGraph { + repeated string names = 1; + repeated Level levels = 2; + int64 total = 3; + int64 max_self = 4; +} +message Level { + repeated int64 values = 1; +} + */ } -const selectSeries = async (req, res) => { - const _req = req.body - const fromTimeSec = Math.floor(req.getStart && req.getStart() - ? parseInt(req.getStart()) / 1000 - : Date.now() / 1000 - HISTORY_TIMESPAN) - const toTimeSec = Math.floor(req.getEnd && req.getEnd() - ? parseInt(req.getEnd()) / 1000 - : Date.now() / 1000) - let typeId = _req.getProfileTypeid && _req.getProfileTypeid() - if (!typeId) { - throw new QrynBadRequest('No type provided') - } - typeId = typeId.match(/^(.+):([^:]+):([^:]+)$/) - if (!typeId) { - throw new QrynBadRequest('Invalid type provided') - } - const sampleTypeId = typeId[2] + ':' + typeId[3] - const labelSelector = _req.getLabelSelector && _req.getLabelSelector() - let groupBy = _req.getGroupByList && _req.getGroupByList() - groupBy = groupBy && groupBy.length ? groupBy : null - const step = _req.getStep && parseInt(_req.getStep()) - if (!step || isNaN(step)) { - throw new QrynBadRequest('No step provided') - } - const aggregation = _req.getAggregation && _req.getAggregation() - - const idxReq = (new Sql.Select()) - .select(new Sql.Raw('fingerprint')) - .from('profiles_series_gin') - .where( - Sql.And( - Sql.Eq('type_id', Sql.val(typeId[1])), - Sql.Gte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)}))`)), - Sql.Lte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)}))`)), - Sql.Eq(new Sql.Raw( - `has(sample_types_units, (${Sql.quoteVal(typeId[2])}, ${Sql.quoteVal(typeId[3])}))`), - 1) - ) - ) - labelSelectorQuery(idxReq, labelSelector) - - const withIdxReq = (new Sql.With('idx', idxReq, false)) - - let tagsReq = 'arraySort(p.tags)' - if (groupBy) { - tagsReq = `arraySort(arrayFilter(x -> x in (${groupBy.map(g => Sql.quoteVal(g)).join(',')}), p.tags))` - } - - const labelsReq = (new Sql.Select()).with(withIdxReq).select( - 'fingerprint', - [new Sql.Raw(tagsReq), 'tags'], - [groupBy ? 'fingerprint' : new Sql.Raw('cityHash64(tags)'), 'new_fingerprint'] - ).distinct(true).from(['profiles_series', 'p']) - .where(Sql.And( - new Sql.In('fingerprint', 'IN', new Sql.WithReference(withIdxReq)), - Sql.Gte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)}))`)), - Sql.Lte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)}))`)) - )) - - const withLabelsReq = new Sql.With('labels', labelsReq, false) - - let valueCol = new Sql.Raw( - `sum(toFloat64(arrayFirst(x -> x.1 == ${Sql.quoteVal(sampleTypeId)}, p.values_agg).2))`) - if (aggregation === types.TimeSeriesAggregationType.TIME_SERIES_AGGREGATION_TYPE_AVERAGE) { - valueCol = new Sql.Raw( - `sum(toFloat64(arrayFirst(x -> x.1 == ${Sql.quoteVal(sampleTypeId)}).2, p.values_agg)) / ` + - `sum(toFloat64(arrayFirst(x -> x.1 == ${Sql.quoteVal(sampleTypeId)}).3, p.values_agg))` - ) - } - - const mainReq = (new Sql.Select()).with(withIdxReq, withLabelsReq).select( - [new Sql.Raw(`intDiv(p.timestamp_ns, 1000000000 * ${step}) * ${step} * 1000`), 'timestamp_ms'], - [new Sql.Raw('labels.new_fingerprint'), 'fingerprint'], - [new Sql.Raw('min(labels.tags)'), 'labels'], - [valueCol, 'value'] - ).from(['profiles', 'p']).join( - new Sql.WithReference(withLabelsReq), - 'ANY LEFT', - Sql.Eq(new Sql.Raw('p.fingerprint'), new Sql.Raw('labels.fingerprint')) - ).where( - Sql.And( - new Sql.In('p.fingerprint', 'IN', new Sql.WithReference(withIdxReq)), - Sql.Gte('p.timestamp_ns', new Sql.Raw(`${fromTimeSec}000000000`)), - Sql.Lt('p.timestamp_ns', new Sql.Raw(`${toTimeSec}000000000`)) - ) - ).groupBy('timestamp_ns', 'fingerprint') - .orderBy(['fingerprint', 'ASC'], ['timestamp_ns', 'ASC']) - const strMainReq = mainReq.toString() - console.log(strMainReq) - const chRes = await clickhouse - .rawRequest(strMainReq + ' FORMAT JSON', null, DATABASE_NAME()) - - let lastFingerprint = null - const seriesList = [] - let lastSeries = null - let lastPoints = [] - for (let i = 0; i < chRes.data.data.length; i++) { - const e = chRes.data.data[i] - if (lastFingerprint !== e.fingerprint) { - lastFingerprint = e.fingerprint - lastSeries && lastSeries.setPointsList(lastPoints) - lastSeries && seriesList.push(lastSeries) - lastPoints = [] - lastSeries = new types.Series() - lastSeries.setLabelsList(e.labels.map(l => { - const lp = new types.LabelPair() - lp.setName(l[0]) - lp.setValue(l[1]) - return lp - })) - } - - const p = new types.Point() - p.setValue(e.value) - p.setTimestamp(e.timestamp_ms) - lastPoints.push(p) - } - lastSeries && lastSeries.setPointsList(lastPoints) - lastSeries && seriesList.push(lastSeries) - +const selectSeries = (req, res) => { const resp = new messages.SelectSeriesResponse() - resp.setSeriesList(seriesList) - return res.code(200).send(Buffer.from(resp.serializeBinary())) + resp.setSeriesList([]) + return res.code(200).send(resp.serializeBinary()) } module.exports.init = (fastify) => { @@ -343,4 +192,45 @@ module.exports.init = (fastify) => { '*': parser(services.QuerierServiceService[name].requestType) }) } +// create a grpc server from services.QuerierServiceService + /*const server = new grpc.Server(); + server.addService(services.QuerierServiceService, { + ProfileTypes: , + LabelValues: (call, cb) => { + + }, + // (types.v1.LabelNamesRequest) returns (types.v1.LabelNamesResponse) {} + LabelNames: (call, cb) => { + + }, + // (SeriesRequest) returns (SeriesResponse) {} + Series: (call, cb) => { + + }, + // SelectMergeStacktraces returns matching profiles aggregated in a flamegraph format. It will combine samples from within the same callstack, with each element being grouped by its function name. + // (SelectMergeStacktracesRequest) returns (SelectMergeStacktracesResponse) {} + SelectMergeStacktraces: (call, cb) => { + + }, + // SelectMergeSpans returns matching profiles aggregated in a flamegraph format. It will combine samples from within the same callstack, with each element being grouped by its function name. + // rpc SelectMergeSpanProfile(SelectMergeSpanProfileRequest) returns (SelectMergeSpanProfileResponse) {} + SelectMergeSpanProfile: (call, cb) => { + + }, + // SelectMergeProfile returns matching profiles aggregated in pprof format. It will contain all information stored (so including filenames and line number, if ingested). + // rpc SelectMergeProfile(SelectMergeProfileRequest) returns (google.v1.Profile) {} + SelectMergeProfile: (call, cb) => {}, + // SelectSeries returns a time series for the total sum of the requested profiles. + // rpc SelectSeries(SelectSeriesRequest) returns (SelectSeriesResponse) {} + SelectSeries: (call, cb) => { + + }, + // rpc Diff(DiffRequest) returns (DiffResponse) {} + Diff: (call, cb) => { + + } + }) + server.bindAsync('0.0.0.0:50051', grpc.ServerCredentials.createInsecure(), () => { + server.start() + })*/ } diff --git a/pyroscope/querier_grpc_pb.js b/pyroscope/querier_grpc_pb.js new file mode 100644 index 00000000..f4660485 --- /dev/null +++ b/pyroscope/querier_grpc_pb.js @@ -0,0 +1,318 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var querier_pb = require('./querier_pb.js'); +var google_v1_profile_pb = require('./google/v1/profile_pb.js'); +var types_v1_types_pb = require('./types/v1/types_pb.js'); + +function serialize_google_v1_Profile(arg) { + if (!(arg instanceof google_v1_profile_pb.Profile)) { + throw new Error('Expected argument of type google.v1.Profile'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_google_v1_Profile(buffer_arg) { + return google_v1_profile_pb.Profile.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_DiffRequest(arg) { + if (!(arg instanceof querier_pb.DiffRequest)) { + throw new Error('Expected argument of type querier.v1.DiffRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_DiffRequest(buffer_arg) { + return querier_pb.DiffRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_DiffResponse(arg) { + if (!(arg instanceof querier_pb.DiffResponse)) { + throw new Error('Expected argument of type querier.v1.DiffResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_DiffResponse(buffer_arg) { + return querier_pb.DiffResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_ProfileTypesRequest(arg) { + if (!(arg instanceof querier_pb.ProfileTypesRequest)) { + throw new Error('Expected argument of type querier.v1.ProfileTypesRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_ProfileTypesRequest(buffer_arg) { + return querier_pb.ProfileTypesRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_ProfileTypesResponse(arg) { + if (!(arg instanceof querier_pb.ProfileTypesResponse)) { + throw new Error('Expected argument of type querier.v1.ProfileTypesResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_ProfileTypesResponse(buffer_arg) { + return querier_pb.ProfileTypesResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_SelectMergeProfileRequest(arg) { + if (!(arg instanceof querier_pb.SelectMergeProfileRequest)) { + throw new Error('Expected argument of type querier.v1.SelectMergeProfileRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_SelectMergeProfileRequest(buffer_arg) { + return querier_pb.SelectMergeProfileRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_SelectMergeSpanProfileRequest(arg) { + if (!(arg instanceof querier_pb.SelectMergeSpanProfileRequest)) { + throw new Error('Expected argument of type querier.v1.SelectMergeSpanProfileRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_SelectMergeSpanProfileRequest(buffer_arg) { + return querier_pb.SelectMergeSpanProfileRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_SelectMergeSpanProfileResponse(arg) { + if (!(arg instanceof querier_pb.SelectMergeSpanProfileResponse)) { + throw new Error('Expected argument of type querier.v1.SelectMergeSpanProfileResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_SelectMergeSpanProfileResponse(buffer_arg) { + return querier_pb.SelectMergeSpanProfileResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_SelectMergeStacktracesRequest(arg) { + if (!(arg instanceof querier_pb.SelectMergeStacktracesRequest)) { + throw new Error('Expected argument of type querier.v1.SelectMergeStacktracesRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_SelectMergeStacktracesRequest(buffer_arg) { + return querier_pb.SelectMergeStacktracesRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_SelectMergeStacktracesResponse(arg) { + if (!(arg instanceof querier_pb.SelectMergeStacktracesResponse)) { + throw new Error('Expected argument of type querier.v1.SelectMergeStacktracesResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_SelectMergeStacktracesResponse(buffer_arg) { + return querier_pb.SelectMergeStacktracesResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_SelectSeriesRequest(arg) { + if (!(arg instanceof querier_pb.SelectSeriesRequest)) { + throw new Error('Expected argument of type querier.v1.SelectSeriesRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_SelectSeriesRequest(buffer_arg) { + return querier_pb.SelectSeriesRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_SelectSeriesResponse(arg) { + if (!(arg instanceof querier_pb.SelectSeriesResponse)) { + throw new Error('Expected argument of type querier.v1.SelectSeriesResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_SelectSeriesResponse(buffer_arg) { + return querier_pb.SelectSeriesResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_SeriesRequest(arg) { + if (!(arg instanceof querier_pb.SeriesRequest)) { + throw new Error('Expected argument of type querier.v1.SeriesRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_SeriesRequest(buffer_arg) { + return querier_pb.SeriesRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_querier_v1_SeriesResponse(arg) { + if (!(arg instanceof querier_pb.SeriesResponse)) { + throw new Error('Expected argument of type querier.v1.SeriesResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_querier_v1_SeriesResponse(buffer_arg) { + return querier_pb.SeriesResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_types_v1_LabelNamesRequest(arg) { + if (!(arg instanceof types_v1_types_pb.LabelNamesRequest)) { + throw new Error('Expected argument of type types.v1.LabelNamesRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_types_v1_LabelNamesRequest(buffer_arg) { + return types_v1_types_pb.LabelNamesRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_types_v1_LabelNamesResponse(arg) { + if (!(arg instanceof types_v1_types_pb.LabelNamesResponse)) { + throw new Error('Expected argument of type types.v1.LabelNamesResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_types_v1_LabelNamesResponse(buffer_arg) { + return types_v1_types_pb.LabelNamesResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_types_v1_LabelValuesRequest(arg) { + if (!(arg instanceof types_v1_types_pb.LabelValuesRequest)) { + throw new Error('Expected argument of type types.v1.LabelValuesRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_types_v1_LabelValuesRequest(buffer_arg) { + return types_v1_types_pb.LabelValuesRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_types_v1_LabelValuesResponse(arg) { + if (!(arg instanceof types_v1_types_pb.LabelValuesResponse)) { + throw new Error('Expected argument of type types.v1.LabelValuesResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_types_v1_LabelValuesResponse(buffer_arg) { + return types_v1_types_pb.LabelValuesResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +var QuerierServiceService = exports.QuerierServiceService = { + // ProfileType returns a list of the existing profile types. +profileTypes: { + path: '/querier.v1.QuerierService/ProfileTypes', + requestStream: false, + responseStream: false, + requestType: querier_pb.ProfileTypesRequest, + responseType: querier_pb.ProfileTypesResponse, + requestSerialize: serialize_querier_v1_ProfileTypesRequest, + requestDeserialize: deserialize_querier_v1_ProfileTypesRequest, + responseSerialize: serialize_querier_v1_ProfileTypesResponse, + responseDeserialize: deserialize_querier_v1_ProfileTypesResponse, + }, + // LabelValues returns the existing label values for the provided label names. +labelValues: { + path: '/querier.v1.QuerierService/LabelValues', + requestStream: false, + responseStream: false, + requestType: types_v1_types_pb.LabelValuesRequest, + responseType: types_v1_types_pb.LabelValuesResponse, + requestSerialize: serialize_types_v1_LabelValuesRequest, + requestDeserialize: deserialize_types_v1_LabelValuesRequest, + responseSerialize: serialize_types_v1_LabelValuesResponse, + responseDeserialize: deserialize_types_v1_LabelValuesResponse, + }, + // LabelNames returns a list of the existing label names. +labelNames: { + path: '/querier.v1.QuerierService/LabelNames', + requestStream: false, + responseStream: false, + requestType: types_v1_types_pb.LabelNamesRequest, + responseType: types_v1_types_pb.LabelNamesResponse, + requestSerialize: serialize_types_v1_LabelNamesRequest, + requestDeserialize: deserialize_types_v1_LabelNamesRequest, + responseSerialize: serialize_types_v1_LabelNamesResponse, + responseDeserialize: deserialize_types_v1_LabelNamesResponse, + }, + // Series returns profiles series matching the request. A series is a unique label set. +series: { + path: '/querier.v1.QuerierService/Series', + requestStream: false, + responseStream: false, + requestType: querier_pb.SeriesRequest, + responseType: querier_pb.SeriesResponse, + requestSerialize: serialize_querier_v1_SeriesRequest, + requestDeserialize: deserialize_querier_v1_SeriesRequest, + responseSerialize: serialize_querier_v1_SeriesResponse, + responseDeserialize: deserialize_querier_v1_SeriesResponse, + }, + // SelectMergeStacktraces returns matching profiles aggregated in a flamegraph format. It will combine samples from within the same callstack, with each element being grouped by its function name. +selectMergeStacktraces: { + path: '/querier.v1.QuerierService/SelectMergeStacktraces', + requestStream: false, + responseStream: false, + requestType: querier_pb.SelectMergeStacktracesRequest, + responseType: querier_pb.SelectMergeStacktracesResponse, + requestSerialize: serialize_querier_v1_SelectMergeStacktracesRequest, + requestDeserialize: deserialize_querier_v1_SelectMergeStacktracesRequest, + responseSerialize: serialize_querier_v1_SelectMergeStacktracesResponse, + responseDeserialize: deserialize_querier_v1_SelectMergeStacktracesResponse, + }, + // SelectMergeSpans returns matching profiles aggregated in a flamegraph format. It will combine samples from within the same callstack, with each element being grouped by its function name. +selectMergeSpanProfile: { + path: '/querier.v1.QuerierService/SelectMergeSpanProfile', + requestStream: false, + responseStream: false, + requestType: querier_pb.SelectMergeSpanProfileRequest, + responseType: querier_pb.SelectMergeSpanProfileResponse, + requestSerialize: serialize_querier_v1_SelectMergeSpanProfileRequest, + requestDeserialize: deserialize_querier_v1_SelectMergeSpanProfileRequest, + responseSerialize: serialize_querier_v1_SelectMergeSpanProfileResponse, + responseDeserialize: deserialize_querier_v1_SelectMergeSpanProfileResponse, + }, + // SelectMergeProfile returns matching profiles aggregated in pprof format. It will contain all information stored (so including filenames and line number, if ingested). +selectMergeProfile: { + path: '/querier.v1.QuerierService/SelectMergeProfile', + requestStream: false, + responseStream: false, + requestType: querier_pb.SelectMergeProfileRequest, + responseType: google_v1_profile_pb.Profile, + requestSerialize: serialize_querier_v1_SelectMergeProfileRequest, + requestDeserialize: deserialize_querier_v1_SelectMergeProfileRequest, + responseSerialize: serialize_google_v1_Profile, + responseDeserialize: deserialize_google_v1_Profile, + }, + // SelectSeries returns a time series for the total sum of the requested profiles. +selectSeries: { + path: '/querier.v1.QuerierService/SelectSeries', + requestStream: false, + responseStream: false, + requestType: querier_pb.SelectSeriesRequest, + responseType: querier_pb.SelectSeriesResponse, + requestSerialize: serialize_querier_v1_SelectSeriesRequest, + requestDeserialize: deserialize_querier_v1_SelectSeriesRequest, + responseSerialize: serialize_querier_v1_SelectSeriesResponse, + responseDeserialize: deserialize_querier_v1_SelectSeriesResponse, + }, + diff: { + path: '/querier.v1.QuerierService/Diff', + requestStream: false, + responseStream: false, + requestType: querier_pb.DiffRequest, + responseType: querier_pb.DiffResponse, + requestSerialize: serialize_querier_v1_DiffRequest, + requestDeserialize: deserialize_querier_v1_DiffRequest, + responseSerialize: serialize_querier_v1_DiffResponse, + responseDeserialize: deserialize_querier_v1_DiffResponse, + }, +}; + +exports.QuerierServiceClient = grpc.makeGenericClientConstructor(QuerierServiceService); diff --git a/pyroscope/querier_pb.js b/pyroscope/querier_pb.js new file mode 100644 index 00000000..8988dda9 --- /dev/null +++ b/pyroscope/querier_pb.js @@ -0,0 +1,3961 @@ +// source: querier.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var google_v1_profile_pb = require('./google/v1/profile_pb.js'); +goog.object.extend(proto, google_v1_profile_pb); +var types_v1_types_pb = require('./types/v1/types_pb.js'); +goog.object.extend(proto, types_v1_types_pb); +goog.exportSymbol('proto.querier.v1.DiffRequest', null, global); +goog.exportSymbol('proto.querier.v1.DiffResponse', null, global); +goog.exportSymbol('proto.querier.v1.FlameGraph', null, global); +goog.exportSymbol('proto.querier.v1.FlameGraphDiff', null, global); +goog.exportSymbol('proto.querier.v1.Level', null, global); +goog.exportSymbol('proto.querier.v1.ProfileTypesRequest', null, global); +goog.exportSymbol('proto.querier.v1.ProfileTypesResponse', null, global); +goog.exportSymbol('proto.querier.v1.SelectMergeProfileRequest', null, global); +goog.exportSymbol('proto.querier.v1.SelectMergeSpanProfileRequest', null, global); +goog.exportSymbol('proto.querier.v1.SelectMergeSpanProfileResponse', null, global); +goog.exportSymbol('proto.querier.v1.SelectMergeStacktracesRequest', null, global); +goog.exportSymbol('proto.querier.v1.SelectMergeStacktracesResponse', null, global); +goog.exportSymbol('proto.querier.v1.SelectSeriesRequest', null, global); +goog.exportSymbol('proto.querier.v1.SelectSeriesResponse', null, global); +goog.exportSymbol('proto.querier.v1.SeriesRequest', null, global); +goog.exportSymbol('proto.querier.v1.SeriesResponse', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.ProfileTypesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.querier.v1.ProfileTypesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.ProfileTypesRequest.displayName = 'proto.querier.v1.ProfileTypesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.ProfileTypesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.querier.v1.ProfileTypesResponse.repeatedFields_, null); +}; +goog.inherits(proto.querier.v1.ProfileTypesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.ProfileTypesResponse.displayName = 'proto.querier.v1.ProfileTypesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.SeriesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.querier.v1.SeriesRequest.repeatedFields_, null); +}; +goog.inherits(proto.querier.v1.SeriesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.SeriesRequest.displayName = 'proto.querier.v1.SeriesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.SeriesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.querier.v1.SeriesResponse.repeatedFields_, null); +}; +goog.inherits(proto.querier.v1.SeriesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.SeriesResponse.displayName = 'proto.querier.v1.SeriesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.SelectMergeStacktracesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.querier.v1.SelectMergeStacktracesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.SelectMergeStacktracesRequest.displayName = 'proto.querier.v1.SelectMergeStacktracesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.SelectMergeStacktracesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.querier.v1.SelectMergeStacktracesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.SelectMergeStacktracesResponse.displayName = 'proto.querier.v1.SelectMergeStacktracesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.SelectMergeSpanProfileRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.querier.v1.SelectMergeSpanProfileRequest.repeatedFields_, null); +}; +goog.inherits(proto.querier.v1.SelectMergeSpanProfileRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.SelectMergeSpanProfileRequest.displayName = 'proto.querier.v1.SelectMergeSpanProfileRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.SelectMergeSpanProfileResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.querier.v1.SelectMergeSpanProfileResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.SelectMergeSpanProfileResponse.displayName = 'proto.querier.v1.SelectMergeSpanProfileResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.DiffRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.querier.v1.DiffRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.DiffRequest.displayName = 'proto.querier.v1.DiffRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.DiffResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.querier.v1.DiffResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.DiffResponse.displayName = 'proto.querier.v1.DiffResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.FlameGraph = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.querier.v1.FlameGraph.repeatedFields_, null); +}; +goog.inherits(proto.querier.v1.FlameGraph, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.FlameGraph.displayName = 'proto.querier.v1.FlameGraph'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.FlameGraphDiff = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.querier.v1.FlameGraphDiff.repeatedFields_, null); +}; +goog.inherits(proto.querier.v1.FlameGraphDiff, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.FlameGraphDiff.displayName = 'proto.querier.v1.FlameGraphDiff'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.Level = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.querier.v1.Level.repeatedFields_, null); +}; +goog.inherits(proto.querier.v1.Level, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.Level.displayName = 'proto.querier.v1.Level'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.SelectMergeProfileRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.querier.v1.SelectMergeProfileRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.SelectMergeProfileRequest.displayName = 'proto.querier.v1.SelectMergeProfileRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.SelectSeriesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.querier.v1.SelectSeriesRequest.repeatedFields_, null); +}; +goog.inherits(proto.querier.v1.SelectSeriesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.SelectSeriesRequest.displayName = 'proto.querier.v1.SelectSeriesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.querier.v1.SelectSeriesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.querier.v1.SelectSeriesResponse.repeatedFields_, null); +}; +goog.inherits(proto.querier.v1.SelectSeriesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.querier.v1.SelectSeriesResponse.displayName = 'proto.querier.v1.SelectSeriesResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.ProfileTypesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.ProfileTypesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.ProfileTypesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.ProfileTypesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + start: jspb.Message.getFieldWithDefault(msg, 1, 0), + end: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.ProfileTypesRequest} + */ +proto.querier.v1.ProfileTypesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.ProfileTypesRequest; + return proto.querier.v1.ProfileTypesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.ProfileTypesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.ProfileTypesRequest} + */ +proto.querier.v1.ProfileTypesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStart(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnd(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.ProfileTypesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.ProfileTypesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.ProfileTypesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.ProfileTypesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStart(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getEnd(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional int64 start = 1; + * @return {number} + */ +proto.querier.v1.ProfileTypesRequest.prototype.getStart = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.ProfileTypesRequest} returns this + */ +proto.querier.v1.ProfileTypesRequest.prototype.setStart = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 end = 2; + * @return {number} + */ +proto.querier.v1.ProfileTypesRequest.prototype.getEnd = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.ProfileTypesRequest} returns this + */ +proto.querier.v1.ProfileTypesRequest.prototype.setEnd = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.querier.v1.ProfileTypesResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.ProfileTypesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.ProfileTypesResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.ProfileTypesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.ProfileTypesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + profileTypesList: jspb.Message.toObjectList(msg.getProfileTypesList(), + types_v1_types_pb.ProfileType.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.ProfileTypesResponse} + */ +proto.querier.v1.ProfileTypesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.ProfileTypesResponse; + return proto.querier.v1.ProfileTypesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.ProfileTypesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.ProfileTypesResponse} + */ +proto.querier.v1.ProfileTypesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new types_v1_types_pb.ProfileType; + reader.readMessage(value,types_v1_types_pb.ProfileType.deserializeBinaryFromReader); + msg.addProfileTypes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.ProfileTypesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.ProfileTypesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.ProfileTypesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.ProfileTypesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProfileTypesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + types_v1_types_pb.ProfileType.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated types.v1.ProfileType profile_types = 1; + * @return {!Array} + */ +proto.querier.v1.ProfileTypesResponse.prototype.getProfileTypesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, types_v1_types_pb.ProfileType, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.ProfileTypesResponse} returns this +*/ +proto.querier.v1.ProfileTypesResponse.prototype.setProfileTypesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.types.v1.ProfileType=} opt_value + * @param {number=} opt_index + * @return {!proto.types.v1.ProfileType} + */ +proto.querier.v1.ProfileTypesResponse.prototype.addProfileTypes = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.types.v1.ProfileType, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.ProfileTypesResponse} returns this + */ +proto.querier.v1.ProfileTypesResponse.prototype.clearProfileTypesList = function() { + return this.setProfileTypesList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.querier.v1.SeriesRequest.repeatedFields_ = [1,2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.SeriesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.SeriesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.SeriesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SeriesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + matchersList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + labelNamesList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + start: jspb.Message.getFieldWithDefault(msg, 3, 0), + end: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.SeriesRequest} + */ +proto.querier.v1.SeriesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.SeriesRequest; + return proto.querier.v1.SeriesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.SeriesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.SeriesRequest} + */ +proto.querier.v1.SeriesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addMatchers(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addLabelNames(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStart(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnd(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.SeriesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.SeriesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.SeriesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SeriesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMatchersList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } + f = message.getLabelNamesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } + f = message.getStart(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getEnd(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * repeated string matchers = 1; + * @return {!Array} + */ +proto.querier.v1.SeriesRequest.prototype.getMatchersList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.SeriesRequest} returns this + */ +proto.querier.v1.SeriesRequest.prototype.setMatchersList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.querier.v1.SeriesRequest} returns this + */ +proto.querier.v1.SeriesRequest.prototype.addMatchers = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.SeriesRequest} returns this + */ +proto.querier.v1.SeriesRequest.prototype.clearMatchersList = function() { + return this.setMatchersList([]); +}; + + +/** + * repeated string label_names = 2; + * @return {!Array} + */ +proto.querier.v1.SeriesRequest.prototype.getLabelNamesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.SeriesRequest} returns this + */ +proto.querier.v1.SeriesRequest.prototype.setLabelNamesList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.querier.v1.SeriesRequest} returns this + */ +proto.querier.v1.SeriesRequest.prototype.addLabelNames = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.SeriesRequest} returns this + */ +proto.querier.v1.SeriesRequest.prototype.clearLabelNamesList = function() { + return this.setLabelNamesList([]); +}; + + +/** + * optional int64 start = 3; + * @return {number} + */ +proto.querier.v1.SeriesRequest.prototype.getStart = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SeriesRequest} returns this + */ +proto.querier.v1.SeriesRequest.prototype.setStart = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 end = 4; + * @return {number} + */ +proto.querier.v1.SeriesRequest.prototype.getEnd = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SeriesRequest} returns this + */ +proto.querier.v1.SeriesRequest.prototype.setEnd = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.querier.v1.SeriesResponse.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.SeriesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.SeriesResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.SeriesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SeriesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + labelsSetList: jspb.Message.toObjectList(msg.getLabelsSetList(), + types_v1_types_pb.Labels.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.SeriesResponse} + */ +proto.querier.v1.SeriesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.SeriesResponse; + return proto.querier.v1.SeriesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.SeriesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.SeriesResponse} + */ +proto.querier.v1.SeriesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = new types_v1_types_pb.Labels; + reader.readMessage(value,types_v1_types_pb.Labels.deserializeBinaryFromReader); + msg.addLabelsSet(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.SeriesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.SeriesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.SeriesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SeriesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLabelsSetList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + types_v1_types_pb.Labels.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated types.v1.Labels labels_set = 2; + * @return {!Array} + */ +proto.querier.v1.SeriesResponse.prototype.getLabelsSetList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, types_v1_types_pb.Labels, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.SeriesResponse} returns this +*/ +proto.querier.v1.SeriesResponse.prototype.setLabelsSetList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.types.v1.Labels=} opt_value + * @param {number=} opt_index + * @return {!proto.types.v1.Labels} + */ +proto.querier.v1.SeriesResponse.prototype.addLabelsSet = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.types.v1.Labels, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.SeriesResponse} returns this + */ +proto.querier.v1.SeriesResponse.prototype.clearLabelsSetList = function() { + return this.setLabelsSetList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.SelectMergeStacktracesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.SelectMergeStacktracesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectMergeStacktracesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + profileTypeid: jspb.Message.getFieldWithDefault(msg, 1, ""), + labelSelector: jspb.Message.getFieldWithDefault(msg, 2, ""), + start: jspb.Message.getFieldWithDefault(msg, 3, 0), + end: jspb.Message.getFieldWithDefault(msg, 4, 0), + maxNodes: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.SelectMergeStacktracesRequest} + */ +proto.querier.v1.SelectMergeStacktracesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.SelectMergeStacktracesRequest; + return proto.querier.v1.SelectMergeStacktracesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.SelectMergeStacktracesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.SelectMergeStacktracesRequest} + */ +proto.querier.v1.SelectMergeStacktracesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setProfileTypeid(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setLabelSelector(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStart(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnd(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setMaxNodes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.SelectMergeStacktracesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.SelectMergeStacktracesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectMergeStacktracesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProfileTypeid(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getLabelSelector(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getStart(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getEnd(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeInt64( + 5, + f + ); + } +}; + + +/** + * optional string profile_typeID = 1; + * @return {string} + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.getProfileTypeid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.querier.v1.SelectMergeStacktracesRequest} returns this + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.setProfileTypeid = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string label_selector = 2; + * @return {string} + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.getLabelSelector = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.querier.v1.SelectMergeStacktracesRequest} returns this + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.setLabelSelector = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional int64 start = 3; + * @return {number} + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.getStart = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectMergeStacktracesRequest} returns this + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.setStart = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 end = 4; + * @return {number} + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.getEnd = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectMergeStacktracesRequest} returns this + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.setEnd = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional int64 max_nodes = 5; + * @return {number} + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.getMaxNodes = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectMergeStacktracesRequest} returns this + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.setMaxNodes = function(value) { + return jspb.Message.setField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.querier.v1.SelectMergeStacktracesRequest} returns this + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.clearMaxNodes = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.querier.v1.SelectMergeStacktracesRequest.prototype.hasMaxNodes = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.SelectMergeStacktracesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.SelectMergeStacktracesResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.SelectMergeStacktracesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectMergeStacktracesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + flamegraph: (f = msg.getFlamegraph()) && proto.querier.v1.FlameGraph.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.SelectMergeStacktracesResponse} + */ +proto.querier.v1.SelectMergeStacktracesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.SelectMergeStacktracesResponse; + return proto.querier.v1.SelectMergeStacktracesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.SelectMergeStacktracesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.SelectMergeStacktracesResponse} + */ +proto.querier.v1.SelectMergeStacktracesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.querier.v1.FlameGraph; + reader.readMessage(value,proto.querier.v1.FlameGraph.deserializeBinaryFromReader); + msg.setFlamegraph(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.SelectMergeStacktracesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.SelectMergeStacktracesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.SelectMergeStacktracesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectMergeStacktracesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFlamegraph(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.querier.v1.FlameGraph.serializeBinaryToWriter + ); + } +}; + + +/** + * optional FlameGraph flamegraph = 1; + * @return {?proto.querier.v1.FlameGraph} + */ +proto.querier.v1.SelectMergeStacktracesResponse.prototype.getFlamegraph = function() { + return /** @type{?proto.querier.v1.FlameGraph} */ ( + jspb.Message.getWrapperField(this, proto.querier.v1.FlameGraph, 1)); +}; + + +/** + * @param {?proto.querier.v1.FlameGraph|undefined} value + * @return {!proto.querier.v1.SelectMergeStacktracesResponse} returns this +*/ +proto.querier.v1.SelectMergeStacktracesResponse.prototype.setFlamegraph = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.querier.v1.SelectMergeStacktracesResponse} returns this + */ +proto.querier.v1.SelectMergeStacktracesResponse.prototype.clearFlamegraph = function() { + return this.setFlamegraph(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.querier.v1.SelectMergeStacktracesResponse.prototype.hasFlamegraph = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.querier.v1.SelectMergeSpanProfileRequest.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.SelectMergeSpanProfileRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.SelectMergeSpanProfileRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectMergeSpanProfileRequest.toObject = function(includeInstance, msg) { + var f, obj = { + profileTypeid: jspb.Message.getFieldWithDefault(msg, 1, ""), + labelSelector: jspb.Message.getFieldWithDefault(msg, 2, ""), + spanSelectorList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + start: jspb.Message.getFieldWithDefault(msg, 4, 0), + end: jspb.Message.getFieldWithDefault(msg, 5, 0), + maxNodes: jspb.Message.getFieldWithDefault(msg, 6, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.SelectMergeSpanProfileRequest} + */ +proto.querier.v1.SelectMergeSpanProfileRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.SelectMergeSpanProfileRequest; + return proto.querier.v1.SelectMergeSpanProfileRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.SelectMergeSpanProfileRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.SelectMergeSpanProfileRequest} + */ +proto.querier.v1.SelectMergeSpanProfileRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setProfileTypeid(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setLabelSelector(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addSpanSelector(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStart(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnd(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt64()); + msg.setMaxNodes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.SelectMergeSpanProfileRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.SelectMergeSpanProfileRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectMergeSpanProfileRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProfileTypeid(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getLabelSelector(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getSpanSelectorList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getStart(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getEnd(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeInt64( + 6, + f + ); + } +}; + + +/** + * optional string profile_typeID = 1; + * @return {string} + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.getProfileTypeid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.querier.v1.SelectMergeSpanProfileRequest} returns this + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.setProfileTypeid = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string label_selector = 2; + * @return {string} + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.getLabelSelector = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.querier.v1.SelectMergeSpanProfileRequest} returns this + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.setLabelSelector = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated string span_selector = 3; + * @return {!Array} + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.getSpanSelectorList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.SelectMergeSpanProfileRequest} returns this + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.setSpanSelectorList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.querier.v1.SelectMergeSpanProfileRequest} returns this + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.addSpanSelector = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.SelectMergeSpanProfileRequest} returns this + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.clearSpanSelectorList = function() { + return this.setSpanSelectorList([]); +}; + + +/** + * optional int64 start = 4; + * @return {number} + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.getStart = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectMergeSpanProfileRequest} returns this + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.setStart = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional int64 end = 5; + * @return {number} + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.getEnd = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectMergeSpanProfileRequest} returns this + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.setEnd = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + +/** + * optional int64 max_nodes = 6; + * @return {number} + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.getMaxNodes = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectMergeSpanProfileRequest} returns this + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.setMaxNodes = function(value) { + return jspb.Message.setField(this, 6, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.querier.v1.SelectMergeSpanProfileRequest} returns this + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.clearMaxNodes = function() { + return jspb.Message.setField(this, 6, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.querier.v1.SelectMergeSpanProfileRequest.prototype.hasMaxNodes = function() { + return jspb.Message.getField(this, 6) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.SelectMergeSpanProfileResponse.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.SelectMergeSpanProfileResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.SelectMergeSpanProfileResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectMergeSpanProfileResponse.toObject = function(includeInstance, msg) { + var f, obj = { + flamegraph: (f = msg.getFlamegraph()) && proto.querier.v1.FlameGraph.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.SelectMergeSpanProfileResponse} + */ +proto.querier.v1.SelectMergeSpanProfileResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.SelectMergeSpanProfileResponse; + return proto.querier.v1.SelectMergeSpanProfileResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.SelectMergeSpanProfileResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.SelectMergeSpanProfileResponse} + */ +proto.querier.v1.SelectMergeSpanProfileResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.querier.v1.FlameGraph; + reader.readMessage(value,proto.querier.v1.FlameGraph.deserializeBinaryFromReader); + msg.setFlamegraph(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.SelectMergeSpanProfileResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.SelectMergeSpanProfileResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.SelectMergeSpanProfileResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectMergeSpanProfileResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFlamegraph(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.querier.v1.FlameGraph.serializeBinaryToWriter + ); + } +}; + + +/** + * optional FlameGraph flamegraph = 1; + * @return {?proto.querier.v1.FlameGraph} + */ +proto.querier.v1.SelectMergeSpanProfileResponse.prototype.getFlamegraph = function() { + return /** @type{?proto.querier.v1.FlameGraph} */ ( + jspb.Message.getWrapperField(this, proto.querier.v1.FlameGraph, 1)); +}; + + +/** + * @param {?proto.querier.v1.FlameGraph|undefined} value + * @return {!proto.querier.v1.SelectMergeSpanProfileResponse} returns this +*/ +proto.querier.v1.SelectMergeSpanProfileResponse.prototype.setFlamegraph = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.querier.v1.SelectMergeSpanProfileResponse} returns this + */ +proto.querier.v1.SelectMergeSpanProfileResponse.prototype.clearFlamegraph = function() { + return this.setFlamegraph(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.querier.v1.SelectMergeSpanProfileResponse.prototype.hasFlamegraph = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.DiffRequest.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.DiffRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.DiffRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.DiffRequest.toObject = function(includeInstance, msg) { + var f, obj = { + left: (f = msg.getLeft()) && proto.querier.v1.SelectMergeStacktracesRequest.toObject(includeInstance, f), + right: (f = msg.getRight()) && proto.querier.v1.SelectMergeStacktracesRequest.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.DiffRequest} + */ +proto.querier.v1.DiffRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.DiffRequest; + return proto.querier.v1.DiffRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.DiffRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.DiffRequest} + */ +proto.querier.v1.DiffRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.querier.v1.SelectMergeStacktracesRequest; + reader.readMessage(value,proto.querier.v1.SelectMergeStacktracesRequest.deserializeBinaryFromReader); + msg.setLeft(value); + break; + case 2: + var value = new proto.querier.v1.SelectMergeStacktracesRequest; + reader.readMessage(value,proto.querier.v1.SelectMergeStacktracesRequest.deserializeBinaryFromReader); + msg.setRight(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.DiffRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.DiffRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.DiffRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.DiffRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLeft(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.querier.v1.SelectMergeStacktracesRequest.serializeBinaryToWriter + ); + } + f = message.getRight(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.querier.v1.SelectMergeStacktracesRequest.serializeBinaryToWriter + ); + } +}; + + +/** + * optional SelectMergeStacktracesRequest left = 1; + * @return {?proto.querier.v1.SelectMergeStacktracesRequest} + */ +proto.querier.v1.DiffRequest.prototype.getLeft = function() { + return /** @type{?proto.querier.v1.SelectMergeStacktracesRequest} */ ( + jspb.Message.getWrapperField(this, proto.querier.v1.SelectMergeStacktracesRequest, 1)); +}; + + +/** + * @param {?proto.querier.v1.SelectMergeStacktracesRequest|undefined} value + * @return {!proto.querier.v1.DiffRequest} returns this +*/ +proto.querier.v1.DiffRequest.prototype.setLeft = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.querier.v1.DiffRequest} returns this + */ +proto.querier.v1.DiffRequest.prototype.clearLeft = function() { + return this.setLeft(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.querier.v1.DiffRequest.prototype.hasLeft = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional SelectMergeStacktracesRequest right = 2; + * @return {?proto.querier.v1.SelectMergeStacktracesRequest} + */ +proto.querier.v1.DiffRequest.prototype.getRight = function() { + return /** @type{?proto.querier.v1.SelectMergeStacktracesRequest} */ ( + jspb.Message.getWrapperField(this, proto.querier.v1.SelectMergeStacktracesRequest, 2)); +}; + + +/** + * @param {?proto.querier.v1.SelectMergeStacktracesRequest|undefined} value + * @return {!proto.querier.v1.DiffRequest} returns this +*/ +proto.querier.v1.DiffRequest.prototype.setRight = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.querier.v1.DiffRequest} returns this + */ +proto.querier.v1.DiffRequest.prototype.clearRight = function() { + return this.setRight(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.querier.v1.DiffRequest.prototype.hasRight = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.DiffResponse.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.DiffResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.DiffResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.DiffResponse.toObject = function(includeInstance, msg) { + var f, obj = { + flamegraph: (f = msg.getFlamegraph()) && proto.querier.v1.FlameGraphDiff.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.DiffResponse} + */ +proto.querier.v1.DiffResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.DiffResponse; + return proto.querier.v1.DiffResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.DiffResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.DiffResponse} + */ +proto.querier.v1.DiffResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.querier.v1.FlameGraphDiff; + reader.readMessage(value,proto.querier.v1.FlameGraphDiff.deserializeBinaryFromReader); + msg.setFlamegraph(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.DiffResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.DiffResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.DiffResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.DiffResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFlamegraph(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.querier.v1.FlameGraphDiff.serializeBinaryToWriter + ); + } +}; + + +/** + * optional FlameGraphDiff flamegraph = 1; + * @return {?proto.querier.v1.FlameGraphDiff} + */ +proto.querier.v1.DiffResponse.prototype.getFlamegraph = function() { + return /** @type{?proto.querier.v1.FlameGraphDiff} */ ( + jspb.Message.getWrapperField(this, proto.querier.v1.FlameGraphDiff, 1)); +}; + + +/** + * @param {?proto.querier.v1.FlameGraphDiff|undefined} value + * @return {!proto.querier.v1.DiffResponse} returns this +*/ +proto.querier.v1.DiffResponse.prototype.setFlamegraph = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.querier.v1.DiffResponse} returns this + */ +proto.querier.v1.DiffResponse.prototype.clearFlamegraph = function() { + return this.setFlamegraph(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.querier.v1.DiffResponse.prototype.hasFlamegraph = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.querier.v1.FlameGraph.repeatedFields_ = [1,2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.FlameGraph.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.FlameGraph.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.FlameGraph} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.FlameGraph.toObject = function(includeInstance, msg) { + var f, obj = { + namesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + levelsList: jspb.Message.toObjectList(msg.getLevelsList(), + proto.querier.v1.Level.toObject, includeInstance), + total: jspb.Message.getFieldWithDefault(msg, 3, 0), + maxSelf: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.FlameGraph} + */ +proto.querier.v1.FlameGraph.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.FlameGraph; + return proto.querier.v1.FlameGraph.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.FlameGraph} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.FlameGraph} + */ +proto.querier.v1.FlameGraph.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addNames(value); + break; + case 2: + var value = new proto.querier.v1.Level; + reader.readMessage(value,proto.querier.v1.Level.deserializeBinaryFromReader); + msg.addLevels(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTotal(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setMaxSelf(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.FlameGraph.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.FlameGraph.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.FlameGraph} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.FlameGraph.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNamesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } + f = message.getLevelsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.querier.v1.Level.serializeBinaryToWriter + ); + } + f = message.getTotal(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getMaxSelf(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * repeated string names = 1; + * @return {!Array} + */ +proto.querier.v1.FlameGraph.prototype.getNamesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.FlameGraph} returns this + */ +proto.querier.v1.FlameGraph.prototype.setNamesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.querier.v1.FlameGraph} returns this + */ +proto.querier.v1.FlameGraph.prototype.addNames = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.FlameGraph} returns this + */ +proto.querier.v1.FlameGraph.prototype.clearNamesList = function() { + return this.setNamesList([]); +}; + + +/** + * repeated Level levels = 2; + * @return {!Array} + */ +proto.querier.v1.FlameGraph.prototype.getLevelsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.querier.v1.Level, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.FlameGraph} returns this +*/ +proto.querier.v1.FlameGraph.prototype.setLevelsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.querier.v1.Level=} opt_value + * @param {number=} opt_index + * @return {!proto.querier.v1.Level} + */ +proto.querier.v1.FlameGraph.prototype.addLevels = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.querier.v1.Level, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.FlameGraph} returns this + */ +proto.querier.v1.FlameGraph.prototype.clearLevelsList = function() { + return this.setLevelsList([]); +}; + + +/** + * optional int64 total = 3; + * @return {number} + */ +proto.querier.v1.FlameGraph.prototype.getTotal = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.FlameGraph} returns this + */ +proto.querier.v1.FlameGraph.prototype.setTotal = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 max_self = 4; + * @return {number} + */ +proto.querier.v1.FlameGraph.prototype.getMaxSelf = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.FlameGraph} returns this + */ +proto.querier.v1.FlameGraph.prototype.setMaxSelf = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.querier.v1.FlameGraphDiff.repeatedFields_ = [1,2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.FlameGraphDiff.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.FlameGraphDiff.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.FlameGraphDiff} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.FlameGraphDiff.toObject = function(includeInstance, msg) { + var f, obj = { + namesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + levelsList: jspb.Message.toObjectList(msg.getLevelsList(), + proto.querier.v1.Level.toObject, includeInstance), + total: jspb.Message.getFieldWithDefault(msg, 3, 0), + maxSelf: jspb.Message.getFieldWithDefault(msg, 4, 0), + leftticks: jspb.Message.getFieldWithDefault(msg, 5, 0), + rightticks: jspb.Message.getFieldWithDefault(msg, 6, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.FlameGraphDiff} + */ +proto.querier.v1.FlameGraphDiff.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.FlameGraphDiff; + return proto.querier.v1.FlameGraphDiff.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.FlameGraphDiff} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.FlameGraphDiff} + */ +proto.querier.v1.FlameGraphDiff.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addNames(value); + break; + case 2: + var value = new proto.querier.v1.Level; + reader.readMessage(value,proto.querier.v1.Level.deserializeBinaryFromReader); + msg.addLevels(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTotal(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setMaxSelf(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLeftticks(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt64()); + msg.setRightticks(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.FlameGraphDiff.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.FlameGraphDiff.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.FlameGraphDiff} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.FlameGraphDiff.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNamesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } + f = message.getLevelsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.querier.v1.Level.serializeBinaryToWriter + ); + } + f = message.getTotal(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getMaxSelf(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getLeftticks(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } + f = message.getRightticks(); + if (f !== 0) { + writer.writeInt64( + 6, + f + ); + } +}; + + +/** + * repeated string names = 1; + * @return {!Array} + */ +proto.querier.v1.FlameGraphDiff.prototype.getNamesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.FlameGraphDiff} returns this + */ +proto.querier.v1.FlameGraphDiff.prototype.setNamesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.querier.v1.FlameGraphDiff} returns this + */ +proto.querier.v1.FlameGraphDiff.prototype.addNames = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.FlameGraphDiff} returns this + */ +proto.querier.v1.FlameGraphDiff.prototype.clearNamesList = function() { + return this.setNamesList([]); +}; + + +/** + * repeated Level levels = 2; + * @return {!Array} + */ +proto.querier.v1.FlameGraphDiff.prototype.getLevelsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.querier.v1.Level, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.FlameGraphDiff} returns this +*/ +proto.querier.v1.FlameGraphDiff.prototype.setLevelsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.querier.v1.Level=} opt_value + * @param {number=} opt_index + * @return {!proto.querier.v1.Level} + */ +proto.querier.v1.FlameGraphDiff.prototype.addLevels = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.querier.v1.Level, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.FlameGraphDiff} returns this + */ +proto.querier.v1.FlameGraphDiff.prototype.clearLevelsList = function() { + return this.setLevelsList([]); +}; + + +/** + * optional int64 total = 3; + * @return {number} + */ +proto.querier.v1.FlameGraphDiff.prototype.getTotal = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.FlameGraphDiff} returns this + */ +proto.querier.v1.FlameGraphDiff.prototype.setTotal = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 max_self = 4; + * @return {number} + */ +proto.querier.v1.FlameGraphDiff.prototype.getMaxSelf = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.FlameGraphDiff} returns this + */ +proto.querier.v1.FlameGraphDiff.prototype.setMaxSelf = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional int64 leftTicks = 5; + * @return {number} + */ +proto.querier.v1.FlameGraphDiff.prototype.getLeftticks = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.FlameGraphDiff} returns this + */ +proto.querier.v1.FlameGraphDiff.prototype.setLeftticks = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + +/** + * optional int64 rightTicks = 6; + * @return {number} + */ +proto.querier.v1.FlameGraphDiff.prototype.getRightticks = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.FlameGraphDiff} returns this + */ +proto.querier.v1.FlameGraphDiff.prototype.setRightticks = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.querier.v1.Level.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.Level.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.Level.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.Level} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.Level.toObject = function(includeInstance, msg) { + var f, obj = { + valuesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.Level} + */ +proto.querier.v1.Level.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.Level; + return proto.querier.v1.Level.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.Level} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.Level} + */ +proto.querier.v1.Level.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt64() : [reader.readInt64()]); + for (var i = 0; i < values.length; i++) { + msg.addValues(values[i]); + } + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.Level.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.Level.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.Level} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.Level.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValuesList(); + if (f.length > 0) { + writer.writePackedInt64( + 1, + f + ); + } +}; + + +/** + * repeated int64 values = 1; + * @return {!Array} + */ +proto.querier.v1.Level.prototype.getValuesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.Level} returns this + */ +proto.querier.v1.Level.prototype.setValuesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.querier.v1.Level} returns this + */ +proto.querier.v1.Level.prototype.addValues = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.Level} returns this + */ +proto.querier.v1.Level.prototype.clearValuesList = function() { + return this.setValuesList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.SelectMergeProfileRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.SelectMergeProfileRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectMergeProfileRequest.toObject = function(includeInstance, msg) { + var f, obj = { + profileTypeid: jspb.Message.getFieldWithDefault(msg, 1, ""), + labelSelector: jspb.Message.getFieldWithDefault(msg, 2, ""), + start: jspb.Message.getFieldWithDefault(msg, 3, 0), + end: jspb.Message.getFieldWithDefault(msg, 4, 0), + maxNodes: jspb.Message.getFieldWithDefault(msg, 5, 0), + stackTraceSelector: (f = msg.getStackTraceSelector()) && types_v1_types_pb.StackTraceSelector.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.SelectMergeProfileRequest} + */ +proto.querier.v1.SelectMergeProfileRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.SelectMergeProfileRequest; + return proto.querier.v1.SelectMergeProfileRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.SelectMergeProfileRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.SelectMergeProfileRequest} + */ +proto.querier.v1.SelectMergeProfileRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setProfileTypeid(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setLabelSelector(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStart(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnd(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setMaxNodes(value); + break; + case 6: + var value = new types_v1_types_pb.StackTraceSelector; + reader.readMessage(value,types_v1_types_pb.StackTraceSelector.deserializeBinaryFromReader); + msg.setStackTraceSelector(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.SelectMergeProfileRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.SelectMergeProfileRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectMergeProfileRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProfileTypeid(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getLabelSelector(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getStart(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getEnd(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeInt64( + 5, + f + ); + } + f = message.getStackTraceSelector(); + if (f != null) { + writer.writeMessage( + 6, + f, + types_v1_types_pb.StackTraceSelector.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string profile_typeID = 1; + * @return {string} + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.getProfileTypeid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.querier.v1.SelectMergeProfileRequest} returns this + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.setProfileTypeid = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string label_selector = 2; + * @return {string} + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.getLabelSelector = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.querier.v1.SelectMergeProfileRequest} returns this + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.setLabelSelector = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional int64 start = 3; + * @return {number} + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.getStart = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectMergeProfileRequest} returns this + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.setStart = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 end = 4; + * @return {number} + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.getEnd = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectMergeProfileRequest} returns this + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.setEnd = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional int64 max_nodes = 5; + * @return {number} + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.getMaxNodes = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectMergeProfileRequest} returns this + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.setMaxNodes = function(value) { + return jspb.Message.setField(this, 5, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.querier.v1.SelectMergeProfileRequest} returns this + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.clearMaxNodes = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.hasMaxNodes = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional types.v1.StackTraceSelector stack_trace_selector = 6; + * @return {?proto.types.v1.StackTraceSelector} + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.getStackTraceSelector = function() { + return /** @type{?proto.types.v1.StackTraceSelector} */ ( + jspb.Message.getWrapperField(this, types_v1_types_pb.StackTraceSelector, 6)); +}; + + +/** + * @param {?proto.types.v1.StackTraceSelector|undefined} value + * @return {!proto.querier.v1.SelectMergeProfileRequest} returns this +*/ +proto.querier.v1.SelectMergeProfileRequest.prototype.setStackTraceSelector = function(value) { + return jspb.Message.setWrapperField(this, 6, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.querier.v1.SelectMergeProfileRequest} returns this + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.clearStackTraceSelector = function() { + return this.setStackTraceSelector(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.querier.v1.SelectMergeProfileRequest.prototype.hasStackTraceSelector = function() { + return jspb.Message.getField(this, 6) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.querier.v1.SelectSeriesRequest.repeatedFields_ = [5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.SelectSeriesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.SelectSeriesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.SelectSeriesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectSeriesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + profileTypeid: jspb.Message.getFieldWithDefault(msg, 1, ""), + labelSelector: jspb.Message.getFieldWithDefault(msg, 2, ""), + start: jspb.Message.getFieldWithDefault(msg, 3, 0), + end: jspb.Message.getFieldWithDefault(msg, 4, 0), + groupByList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, + step: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0), + aggregation: jspb.Message.getFieldWithDefault(msg, 7, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.SelectSeriesRequest} + */ +proto.querier.v1.SelectSeriesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.SelectSeriesRequest; + return proto.querier.v1.SelectSeriesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.SelectSeriesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.SelectSeriesRequest} + */ +proto.querier.v1.SelectSeriesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setProfileTypeid(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setLabelSelector(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStart(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnd(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.addGroupBy(value); + break; + case 6: + var value = /** @type {number} */ (reader.readDouble()); + msg.setStep(value); + break; + case 7: + var value = /** @type {!proto.types.v1.TimeSeriesAggregationType} */ (reader.readEnum()); + msg.setAggregation(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.SelectSeriesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.SelectSeriesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.SelectSeriesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectSeriesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProfileTypeid(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getLabelSelector(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getStart(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getEnd(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getGroupByList(); + if (f.length > 0) { + writer.writeRepeatedString( + 5, + f + ); + } + f = message.getStep(); + if (f !== 0.0) { + writer.writeDouble( + 6, + f + ); + } + f = /** @type {!proto.types.v1.TimeSeriesAggregationType} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeEnum( + 7, + f + ); + } +}; + + +/** + * optional string profile_typeID = 1; + * @return {string} + */ +proto.querier.v1.SelectSeriesRequest.prototype.getProfileTypeid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.querier.v1.SelectSeriesRequest} returns this + */ +proto.querier.v1.SelectSeriesRequest.prototype.setProfileTypeid = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string label_selector = 2; + * @return {string} + */ +proto.querier.v1.SelectSeriesRequest.prototype.getLabelSelector = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.querier.v1.SelectSeriesRequest} returns this + */ +proto.querier.v1.SelectSeriesRequest.prototype.setLabelSelector = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional int64 start = 3; + * @return {number} + */ +proto.querier.v1.SelectSeriesRequest.prototype.getStart = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectSeriesRequest} returns this + */ +proto.querier.v1.SelectSeriesRequest.prototype.setStart = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 end = 4; + * @return {number} + */ +proto.querier.v1.SelectSeriesRequest.prototype.getEnd = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectSeriesRequest} returns this + */ +proto.querier.v1.SelectSeriesRequest.prototype.setEnd = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * repeated string group_by = 5; + * @return {!Array} + */ +proto.querier.v1.SelectSeriesRequest.prototype.getGroupByList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.SelectSeriesRequest} returns this + */ +proto.querier.v1.SelectSeriesRequest.prototype.setGroupByList = function(value) { + return jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.querier.v1.SelectSeriesRequest} returns this + */ +proto.querier.v1.SelectSeriesRequest.prototype.addGroupBy = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.SelectSeriesRequest} returns this + */ +proto.querier.v1.SelectSeriesRequest.prototype.clearGroupByList = function() { + return this.setGroupByList([]); +}; + + +/** + * optional double step = 6; + * @return {number} + */ +proto.querier.v1.SelectSeriesRequest.prototype.getStep = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.querier.v1.SelectSeriesRequest} returns this + */ +proto.querier.v1.SelectSeriesRequest.prototype.setStep = function(value) { + return jspb.Message.setProto3FloatField(this, 6, value); +}; + + +/** + * optional types.v1.TimeSeriesAggregationType aggregation = 7; + * @return {!proto.types.v1.TimeSeriesAggregationType} + */ +proto.querier.v1.SelectSeriesRequest.prototype.getAggregation = function() { + return /** @type {!proto.types.v1.TimeSeriesAggregationType} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** + * @param {!proto.types.v1.TimeSeriesAggregationType} value + * @return {!proto.querier.v1.SelectSeriesRequest} returns this + */ +proto.querier.v1.SelectSeriesRequest.prototype.setAggregation = function(value) { + return jspb.Message.setField(this, 7, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.querier.v1.SelectSeriesRequest} returns this + */ +proto.querier.v1.SelectSeriesRequest.prototype.clearAggregation = function() { + return jspb.Message.setField(this, 7, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.querier.v1.SelectSeriesRequest.prototype.hasAggregation = function() { + return jspb.Message.getField(this, 7) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.querier.v1.SelectSeriesResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.querier.v1.SelectSeriesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.querier.v1.SelectSeriesResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.querier.v1.SelectSeriesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectSeriesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + seriesList: jspb.Message.toObjectList(msg.getSeriesList(), + types_v1_types_pb.Series.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.querier.v1.SelectSeriesResponse} + */ +proto.querier.v1.SelectSeriesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.querier.v1.SelectSeriesResponse; + return proto.querier.v1.SelectSeriesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.querier.v1.SelectSeriesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.querier.v1.SelectSeriesResponse} + */ +proto.querier.v1.SelectSeriesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new types_v1_types_pb.Series; + reader.readMessage(value,types_v1_types_pb.Series.deserializeBinaryFromReader); + msg.addSeries(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.querier.v1.SelectSeriesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.querier.v1.SelectSeriesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.querier.v1.SelectSeriesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.querier.v1.SelectSeriesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSeriesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + types_v1_types_pb.Series.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated types.v1.Series series = 1; + * @return {!Array} + */ +proto.querier.v1.SelectSeriesResponse.prototype.getSeriesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, types_v1_types_pb.Series, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.querier.v1.SelectSeriesResponse} returns this +*/ +proto.querier.v1.SelectSeriesResponse.prototype.setSeriesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.types.v1.Series=} opt_value + * @param {number=} opt_index + * @return {!proto.types.v1.Series} + */ +proto.querier.v1.SelectSeriesResponse.prototype.addSeries = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.types.v1.Series, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.querier.v1.SelectSeriesResponse} returns this + */ +proto.querier.v1.SelectSeriesResponse.prototype.clearSeriesList = function() { + return this.setSeriesList([]); +}; + + +goog.object.extend(exports, proto.querier.v1); diff --git a/pyroscope/types/v1/types_grpc_pb.js b/pyroscope/types/v1/types_grpc_pb.js new file mode 100644 index 00000000..97b3a246 --- /dev/null +++ b/pyroscope/types/v1/types_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/pyroscope/types/v1/types_pb.js b/pyroscope/types/v1/types_pb.js new file mode 100644 index 00000000..d100d698 --- /dev/null +++ b/pyroscope/types/v1/types_pb.js @@ -0,0 +1,2892 @@ +// source: types/v1/types.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +goog.exportSymbol('proto.types.v1.BlockCompaction', null, global); +goog.exportSymbol('proto.types.v1.BlockInfo', null, global); +goog.exportSymbol('proto.types.v1.LabelNamesRequest', null, global); +goog.exportSymbol('proto.types.v1.LabelNamesResponse', null, global); +goog.exportSymbol('proto.types.v1.LabelPair', null, global); +goog.exportSymbol('proto.types.v1.LabelValuesRequest', null, global); +goog.exportSymbol('proto.types.v1.LabelValuesResponse', null, global); +goog.exportSymbol('proto.types.v1.Labels', null, global); +goog.exportSymbol('proto.types.v1.Location', null, global); +goog.exportSymbol('proto.types.v1.Point', null, global); +goog.exportSymbol('proto.types.v1.ProfileType', null, global); +goog.exportSymbol('proto.types.v1.Series', null, global); +goog.exportSymbol('proto.types.v1.StackTraceSelector', null, global); +goog.exportSymbol('proto.types.v1.TimeSeriesAggregationType', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.LabelPair = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.types.v1.LabelPair, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.LabelPair.displayName = 'proto.types.v1.LabelPair'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.ProfileType = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.types.v1.ProfileType, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.ProfileType.displayName = 'proto.types.v1.ProfileType'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.Labels = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.types.v1.Labels.repeatedFields_, null); +}; +goog.inherits(proto.types.v1.Labels, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.Labels.displayName = 'proto.types.v1.Labels'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.Series = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.types.v1.Series.repeatedFields_, null); +}; +goog.inherits(proto.types.v1.Series, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.Series.displayName = 'proto.types.v1.Series'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.Point = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.types.v1.Point, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.Point.displayName = 'proto.types.v1.Point'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.LabelValuesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.types.v1.LabelValuesRequest.repeatedFields_, null); +}; +goog.inherits(proto.types.v1.LabelValuesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.LabelValuesRequest.displayName = 'proto.types.v1.LabelValuesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.LabelValuesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.types.v1.LabelValuesResponse.repeatedFields_, null); +}; +goog.inherits(proto.types.v1.LabelValuesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.LabelValuesResponse.displayName = 'proto.types.v1.LabelValuesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.LabelNamesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.types.v1.LabelNamesRequest.repeatedFields_, null); +}; +goog.inherits(proto.types.v1.LabelNamesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.LabelNamesRequest.displayName = 'proto.types.v1.LabelNamesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.LabelNamesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.types.v1.LabelNamesResponse.repeatedFields_, null); +}; +goog.inherits(proto.types.v1.LabelNamesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.LabelNamesResponse.displayName = 'proto.types.v1.LabelNamesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.BlockInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.types.v1.BlockInfo.repeatedFields_, null); +}; +goog.inherits(proto.types.v1.BlockInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.BlockInfo.displayName = 'proto.types.v1.BlockInfo'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.BlockCompaction = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.types.v1.BlockCompaction.repeatedFields_, null); +}; +goog.inherits(proto.types.v1.BlockCompaction, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.BlockCompaction.displayName = 'proto.types.v1.BlockCompaction'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.StackTraceSelector = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.types.v1.StackTraceSelector.repeatedFields_, null); +}; +goog.inherits(proto.types.v1.StackTraceSelector, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.StackTraceSelector.displayName = 'proto.types.v1.StackTraceSelector'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.types.v1.Location = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.types.v1.Location, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.v1.Location.displayName = 'proto.types.v1.Location'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.LabelPair.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.LabelPair.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.LabelPair} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.LabelPair.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + value: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.LabelPair} + */ +proto.types.v1.LabelPair.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.LabelPair; + return proto.types.v1.LabelPair.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.LabelPair} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.LabelPair} + */ +proto.types.v1.LabelPair.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.LabelPair.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.LabelPair.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.LabelPair} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.LabelPair.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getValue(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.types.v1.LabelPair.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.types.v1.LabelPair} returns this + */ +proto.types.v1.LabelPair.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string value = 2; + * @return {string} + */ +proto.types.v1.LabelPair.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.types.v1.LabelPair} returns this + */ +proto.types.v1.LabelPair.prototype.setValue = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.ProfileType.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.ProfileType.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.ProfileType} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.ProfileType.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + name: jspb.Message.getFieldWithDefault(msg, 2, ""), + sampleType: jspb.Message.getFieldWithDefault(msg, 4, ""), + sampleUnit: jspb.Message.getFieldWithDefault(msg, 5, ""), + periodType: jspb.Message.getFieldWithDefault(msg, 6, ""), + periodUnit: jspb.Message.getFieldWithDefault(msg, 7, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.ProfileType} + */ +proto.types.v1.ProfileType.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.ProfileType; + return proto.types.v1.ProfileType.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.ProfileType} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.ProfileType} + */ +proto.types.v1.ProfileType.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setSampleType(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setSampleUnit(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setPeriodType(value); + break; + case 7: + var value = /** @type {string} */ (reader.readString()); + msg.setPeriodUnit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.ProfileType.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.ProfileType.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.ProfileType} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.ProfileType.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getSampleType(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getSampleUnit(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getPeriodType(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getPeriodUnit(); + if (f.length > 0) { + writer.writeString( + 7, + f + ); + } +}; + + +/** + * optional string ID = 1; + * @return {string} + */ +proto.types.v1.ProfileType.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.types.v1.ProfileType} returns this + */ +proto.types.v1.ProfileType.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.types.v1.ProfileType.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.types.v1.ProfileType} returns this + */ +proto.types.v1.ProfileType.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string sample_type = 4; + * @return {string} + */ +proto.types.v1.ProfileType.prototype.getSampleType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * @param {string} value + * @return {!proto.types.v1.ProfileType} returns this + */ +proto.types.v1.ProfileType.prototype.setSampleType = function(value) { + return jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string sample_unit = 5; + * @return {string} + */ +proto.types.v1.ProfileType.prototype.getSampleUnit = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.types.v1.ProfileType} returns this + */ +proto.types.v1.ProfileType.prototype.setSampleUnit = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string period_type = 6; + * @return {string} + */ +proto.types.v1.ProfileType.prototype.getPeriodType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** + * @param {string} value + * @return {!proto.types.v1.ProfileType} returns this + */ +proto.types.v1.ProfileType.prototype.setPeriodType = function(value) { + return jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional string period_unit = 7; + * @return {string} + */ +proto.types.v1.ProfileType.prototype.getPeriodUnit = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +}; + + +/** + * @param {string} value + * @return {!proto.types.v1.ProfileType} returns this + */ +proto.types.v1.ProfileType.prototype.setPeriodUnit = function(value) { + return jspb.Message.setProto3StringField(this, 7, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.types.v1.Labels.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.Labels.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.Labels.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.Labels} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.Labels.toObject = function(includeInstance, msg) { + var f, obj = { + labelsList: jspb.Message.toObjectList(msg.getLabelsList(), + proto.types.v1.LabelPair.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.Labels} + */ +proto.types.v1.Labels.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.Labels; + return proto.types.v1.Labels.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.Labels} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.Labels} + */ +proto.types.v1.Labels.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.types.v1.LabelPair; + reader.readMessage(value,proto.types.v1.LabelPair.deserializeBinaryFromReader); + msg.addLabels(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.Labels.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.Labels.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.Labels} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.Labels.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLabelsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.types.v1.LabelPair.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated LabelPair labels = 1; + * @return {!Array} + */ +proto.types.v1.Labels.prototype.getLabelsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.types.v1.LabelPair, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.types.v1.Labels} returns this +*/ +proto.types.v1.Labels.prototype.setLabelsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.types.v1.LabelPair=} opt_value + * @param {number=} opt_index + * @return {!proto.types.v1.LabelPair} + */ +proto.types.v1.Labels.prototype.addLabels = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.types.v1.LabelPair, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.types.v1.Labels} returns this + */ +proto.types.v1.Labels.prototype.clearLabelsList = function() { + return this.setLabelsList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.types.v1.Series.repeatedFields_ = [1,2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.Series.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.Series.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.Series} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.Series.toObject = function(includeInstance, msg) { + var f, obj = { + labelsList: jspb.Message.toObjectList(msg.getLabelsList(), + proto.types.v1.LabelPair.toObject, includeInstance), + pointsList: jspb.Message.toObjectList(msg.getPointsList(), + proto.types.v1.Point.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.Series} + */ +proto.types.v1.Series.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.Series; + return proto.types.v1.Series.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.Series} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.Series} + */ +proto.types.v1.Series.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.types.v1.LabelPair; + reader.readMessage(value,proto.types.v1.LabelPair.deserializeBinaryFromReader); + msg.addLabels(value); + break; + case 2: + var value = new proto.types.v1.Point; + reader.readMessage(value,proto.types.v1.Point.deserializeBinaryFromReader); + msg.addPoints(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.Series.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.Series.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.Series} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.Series.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLabelsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.types.v1.LabelPair.serializeBinaryToWriter + ); + } + f = message.getPointsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.types.v1.Point.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated LabelPair labels = 1; + * @return {!Array} + */ +proto.types.v1.Series.prototype.getLabelsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.types.v1.LabelPair, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.types.v1.Series} returns this +*/ +proto.types.v1.Series.prototype.setLabelsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.types.v1.LabelPair=} opt_value + * @param {number=} opt_index + * @return {!proto.types.v1.LabelPair} + */ +proto.types.v1.Series.prototype.addLabels = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.types.v1.LabelPair, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.types.v1.Series} returns this + */ +proto.types.v1.Series.prototype.clearLabelsList = function() { + return this.setLabelsList([]); +}; + + +/** + * repeated Point points = 2; + * @return {!Array} + */ +proto.types.v1.Series.prototype.getPointsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.types.v1.Point, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.types.v1.Series} returns this +*/ +proto.types.v1.Series.prototype.setPointsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.types.v1.Point=} opt_value + * @param {number=} opt_index + * @return {!proto.types.v1.Point} + */ +proto.types.v1.Series.prototype.addPoints = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.types.v1.Point, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.types.v1.Series} returns this + */ +proto.types.v1.Series.prototype.clearPointsList = function() { + return this.setPointsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.Point.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.Point.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.Point} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.Point.toObject = function(includeInstance, msg) { + var f, obj = { + value: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0), + timestamp: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.Point} + */ +proto.types.v1.Point.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.Point; + return proto.types.v1.Point.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.Point} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.Point} + */ +proto.types.v1.Point.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readDouble()); + msg.setValue(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimestamp(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.Point.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.Point.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.Point} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.Point.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValue(); + if (f !== 0.0) { + writer.writeDouble( + 1, + f + ); + } + f = message.getTimestamp(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional double value = 1; + * @return {number} + */ +proto.types.v1.Point.prototype.getValue = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.types.v1.Point} returns this + */ +proto.types.v1.Point.prototype.setValue = function(value) { + return jspb.Message.setProto3FloatField(this, 1, value); +}; + + +/** + * optional int64 timestamp = 2; + * @return {number} + */ +proto.types.v1.Point.prototype.getTimestamp = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.types.v1.Point} returns this + */ +proto.types.v1.Point.prototype.setTimestamp = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.types.v1.LabelValuesRequest.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.LabelValuesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.LabelValuesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.LabelValuesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.LabelValuesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + matchersList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + start: jspb.Message.getFieldWithDefault(msg, 3, 0), + end: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.LabelValuesRequest} + */ +proto.types.v1.LabelValuesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.LabelValuesRequest; + return proto.types.v1.LabelValuesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.LabelValuesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.LabelValuesRequest} + */ +proto.types.v1.LabelValuesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addMatchers(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStart(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnd(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.LabelValuesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.LabelValuesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.LabelValuesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.LabelValuesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getMatchersList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } + f = message.getStart(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getEnd(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.types.v1.LabelValuesRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.types.v1.LabelValuesRequest} returns this + */ +proto.types.v1.LabelValuesRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated string matchers = 2; + * @return {!Array} + */ +proto.types.v1.LabelValuesRequest.prototype.getMatchersList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.types.v1.LabelValuesRequest} returns this + */ +proto.types.v1.LabelValuesRequest.prototype.setMatchersList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.types.v1.LabelValuesRequest} returns this + */ +proto.types.v1.LabelValuesRequest.prototype.addMatchers = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.types.v1.LabelValuesRequest} returns this + */ +proto.types.v1.LabelValuesRequest.prototype.clearMatchersList = function() { + return this.setMatchersList([]); +}; + + +/** + * optional int64 start = 3; + * @return {number} + */ +proto.types.v1.LabelValuesRequest.prototype.getStart = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.types.v1.LabelValuesRequest} returns this + */ +proto.types.v1.LabelValuesRequest.prototype.setStart = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 end = 4; + * @return {number} + */ +proto.types.v1.LabelValuesRequest.prototype.getEnd = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.types.v1.LabelValuesRequest} returns this + */ +proto.types.v1.LabelValuesRequest.prototype.setEnd = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.types.v1.LabelValuesResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.LabelValuesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.LabelValuesResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.LabelValuesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.LabelValuesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + namesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.LabelValuesResponse} + */ +proto.types.v1.LabelValuesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.LabelValuesResponse; + return proto.types.v1.LabelValuesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.LabelValuesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.LabelValuesResponse} + */ +proto.types.v1.LabelValuesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addNames(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.LabelValuesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.LabelValuesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.LabelValuesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.LabelValuesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNamesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string names = 1; + * @return {!Array} + */ +proto.types.v1.LabelValuesResponse.prototype.getNamesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.types.v1.LabelValuesResponse} returns this + */ +proto.types.v1.LabelValuesResponse.prototype.setNamesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.types.v1.LabelValuesResponse} returns this + */ +proto.types.v1.LabelValuesResponse.prototype.addNames = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.types.v1.LabelValuesResponse} returns this + */ +proto.types.v1.LabelValuesResponse.prototype.clearNamesList = function() { + return this.setNamesList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.types.v1.LabelNamesRequest.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.LabelNamesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.LabelNamesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.LabelNamesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.LabelNamesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + matchersList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + start: jspb.Message.getFieldWithDefault(msg, 2, 0), + end: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.LabelNamesRequest} + */ +proto.types.v1.LabelNamesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.LabelNamesRequest; + return proto.types.v1.LabelNamesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.LabelNamesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.LabelNamesRequest} + */ +proto.types.v1.LabelNamesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addMatchers(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStart(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEnd(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.LabelNamesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.LabelNamesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.LabelNamesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.LabelNamesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMatchersList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } + f = message.getStart(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getEnd(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } +}; + + +/** + * repeated string matchers = 1; + * @return {!Array} + */ +proto.types.v1.LabelNamesRequest.prototype.getMatchersList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.types.v1.LabelNamesRequest} returns this + */ +proto.types.v1.LabelNamesRequest.prototype.setMatchersList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.types.v1.LabelNamesRequest} returns this + */ +proto.types.v1.LabelNamesRequest.prototype.addMatchers = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.types.v1.LabelNamesRequest} returns this + */ +proto.types.v1.LabelNamesRequest.prototype.clearMatchersList = function() { + return this.setMatchersList([]); +}; + + +/** + * optional int64 start = 2; + * @return {number} + */ +proto.types.v1.LabelNamesRequest.prototype.getStart = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.types.v1.LabelNamesRequest} returns this + */ +proto.types.v1.LabelNamesRequest.prototype.setStart = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 end = 3; + * @return {number} + */ +proto.types.v1.LabelNamesRequest.prototype.getEnd = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.types.v1.LabelNamesRequest} returns this + */ +proto.types.v1.LabelNamesRequest.prototype.setEnd = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.types.v1.LabelNamesResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.LabelNamesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.LabelNamesResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.LabelNamesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.LabelNamesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + namesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.LabelNamesResponse} + */ +proto.types.v1.LabelNamesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.LabelNamesResponse; + return proto.types.v1.LabelNamesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.LabelNamesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.LabelNamesResponse} + */ +proto.types.v1.LabelNamesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addNames(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.LabelNamesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.LabelNamesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.LabelNamesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.LabelNamesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNamesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string names = 1; + * @return {!Array} + */ +proto.types.v1.LabelNamesResponse.prototype.getNamesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.types.v1.LabelNamesResponse} returns this + */ +proto.types.v1.LabelNamesResponse.prototype.setNamesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.types.v1.LabelNamesResponse} returns this + */ +proto.types.v1.LabelNamesResponse.prototype.addNames = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.types.v1.LabelNamesResponse} returns this + */ +proto.types.v1.LabelNamesResponse.prototype.clearNamesList = function() { + return this.setNamesList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.types.v1.BlockInfo.repeatedFields_ = [5]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.BlockInfo.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.BlockInfo.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.BlockInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.BlockInfo.toObject = function(includeInstance, msg) { + var f, obj = { + ulid: jspb.Message.getFieldWithDefault(msg, 1, ""), + minTime: jspb.Message.getFieldWithDefault(msg, 2, 0), + maxTime: jspb.Message.getFieldWithDefault(msg, 3, 0), + compaction: (f = msg.getCompaction()) && proto.types.v1.BlockCompaction.toObject(includeInstance, f), + labelsList: jspb.Message.toObjectList(msg.getLabelsList(), + proto.types.v1.LabelPair.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.BlockInfo} + */ +proto.types.v1.BlockInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.BlockInfo; + return proto.types.v1.BlockInfo.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.BlockInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.BlockInfo} + */ +proto.types.v1.BlockInfo.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setUlid(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setMinTime(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setMaxTime(value); + break; + case 4: + var value = new proto.types.v1.BlockCompaction; + reader.readMessage(value,proto.types.v1.BlockCompaction.deserializeBinaryFromReader); + msg.setCompaction(value); + break; + case 5: + var value = new proto.types.v1.LabelPair; + reader.readMessage(value,proto.types.v1.LabelPair.deserializeBinaryFromReader); + msg.addLabels(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.BlockInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.BlockInfo.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.BlockInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.BlockInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getUlid(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getMinTime(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getMaxTime(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getCompaction(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.types.v1.BlockCompaction.serializeBinaryToWriter + ); + } + f = message.getLabelsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.types.v1.LabelPair.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string ulid = 1; + * @return {string} + */ +proto.types.v1.BlockInfo.prototype.getUlid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.types.v1.BlockInfo} returns this + */ +proto.types.v1.BlockInfo.prototype.setUlid = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional int64 min_time = 2; + * @return {number} + */ +proto.types.v1.BlockInfo.prototype.getMinTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.types.v1.BlockInfo} returns this + */ +proto.types.v1.BlockInfo.prototype.setMinTime = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 max_time = 3; + * @return {number} + */ +proto.types.v1.BlockInfo.prototype.getMaxTime = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.types.v1.BlockInfo} returns this + */ +proto.types.v1.BlockInfo.prototype.setMaxTime = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional BlockCompaction compaction = 4; + * @return {?proto.types.v1.BlockCompaction} + */ +proto.types.v1.BlockInfo.prototype.getCompaction = function() { + return /** @type{?proto.types.v1.BlockCompaction} */ ( + jspb.Message.getWrapperField(this, proto.types.v1.BlockCompaction, 4)); +}; + + +/** + * @param {?proto.types.v1.BlockCompaction|undefined} value + * @return {!proto.types.v1.BlockInfo} returns this +*/ +proto.types.v1.BlockInfo.prototype.setCompaction = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.types.v1.BlockInfo} returns this + */ +proto.types.v1.BlockInfo.prototype.clearCompaction = function() { + return this.setCompaction(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.types.v1.BlockInfo.prototype.hasCompaction = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * repeated LabelPair labels = 5; + * @return {!Array} + */ +proto.types.v1.BlockInfo.prototype.getLabelsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.types.v1.LabelPair, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.types.v1.BlockInfo} returns this +*/ +proto.types.v1.BlockInfo.prototype.setLabelsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.types.v1.LabelPair=} opt_value + * @param {number=} opt_index + * @return {!proto.types.v1.LabelPair} + */ +proto.types.v1.BlockInfo.prototype.addLabels = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.types.v1.LabelPair, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.types.v1.BlockInfo} returns this + */ +proto.types.v1.BlockInfo.prototype.clearLabelsList = function() { + return this.setLabelsList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.types.v1.BlockCompaction.repeatedFields_ = [2,3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.BlockCompaction.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.BlockCompaction.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.BlockCompaction} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.BlockCompaction.toObject = function(includeInstance, msg) { + var f, obj = { + level: jspb.Message.getFieldWithDefault(msg, 1, 0), + sourcesList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + parentsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.BlockCompaction} + */ +proto.types.v1.BlockCompaction.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.BlockCompaction; + return proto.types.v1.BlockCompaction.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.BlockCompaction} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.BlockCompaction} + */ +proto.types.v1.BlockCompaction.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setLevel(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.addSources(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addParents(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.BlockCompaction.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.BlockCompaction.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.BlockCompaction} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.BlockCompaction.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLevel(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getSourcesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 2, + f + ); + } + f = message.getParentsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } +}; + + +/** + * optional int32 level = 1; + * @return {number} + */ +proto.types.v1.BlockCompaction.prototype.getLevel = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.types.v1.BlockCompaction} returns this + */ +proto.types.v1.BlockCompaction.prototype.setLevel = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * repeated string sources = 2; + * @return {!Array} + */ +proto.types.v1.BlockCompaction.prototype.getSourcesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.types.v1.BlockCompaction} returns this + */ +proto.types.v1.BlockCompaction.prototype.setSourcesList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.types.v1.BlockCompaction} returns this + */ +proto.types.v1.BlockCompaction.prototype.addSources = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.types.v1.BlockCompaction} returns this + */ +proto.types.v1.BlockCompaction.prototype.clearSourcesList = function() { + return this.setSourcesList([]); +}; + + +/** + * repeated string parents = 3; + * @return {!Array} + */ +proto.types.v1.BlockCompaction.prototype.getParentsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.types.v1.BlockCompaction} returns this + */ +proto.types.v1.BlockCompaction.prototype.setParentsList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.types.v1.BlockCompaction} returns this + */ +proto.types.v1.BlockCompaction.prototype.addParents = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.types.v1.BlockCompaction} returns this + */ +proto.types.v1.BlockCompaction.prototype.clearParentsList = function() { + return this.setParentsList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.types.v1.StackTraceSelector.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.StackTraceSelector.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.StackTraceSelector.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.StackTraceSelector} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.StackTraceSelector.toObject = function(includeInstance, msg) { + var f, obj = { + stackTraceList: jspb.Message.toObjectList(msg.getStackTraceList(), + proto.types.v1.Location.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.StackTraceSelector} + */ +proto.types.v1.StackTraceSelector.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.StackTraceSelector; + return proto.types.v1.StackTraceSelector.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.StackTraceSelector} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.StackTraceSelector} + */ +proto.types.v1.StackTraceSelector.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.types.v1.Location; + reader.readMessage(value,proto.types.v1.Location.deserializeBinaryFromReader); + msg.addStackTrace(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.StackTraceSelector.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.StackTraceSelector.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.StackTraceSelector} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.StackTraceSelector.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStackTraceList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.types.v1.Location.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Location stack_trace = 1; + * @return {!Array} + */ +proto.types.v1.StackTraceSelector.prototype.getStackTraceList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.types.v1.Location, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.types.v1.StackTraceSelector} returns this +*/ +proto.types.v1.StackTraceSelector.prototype.setStackTraceList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.types.v1.Location=} opt_value + * @param {number=} opt_index + * @return {!proto.types.v1.Location} + */ +proto.types.v1.StackTraceSelector.prototype.addStackTrace = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.types.v1.Location, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.types.v1.StackTraceSelector} returns this + */ +proto.types.v1.StackTraceSelector.prototype.clearStackTraceList = function() { + return this.setStackTraceList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.v1.Location.prototype.toObject = function(opt_includeInstance) { + return proto.types.v1.Location.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.v1.Location} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.Location.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.types.v1.Location} + */ +proto.types.v1.Location.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.v1.Location; + return proto.types.v1.Location.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.v1.Location} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.v1.Location} + */ +proto.types.v1.Location.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.v1.Location.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.v1.Location.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.v1.Location} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.v1.Location.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.types.v1.Location.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.types.v1.Location} returns this + */ +proto.types.v1.Location.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * @enum {number} + */ +proto.types.v1.TimeSeriesAggregationType = { + TIME_SERIES_AGGREGATION_TYPE_SUM: 0, + TIME_SERIES_AGGREGATION_TYPE_AVERAGE: 1 +}; + +goog.object.extend(exports, proto.types.v1); From 20cd680f1dc59f1f010cce102593031dae285694 Mon Sep 17 00:00:00 2001 From: akvlad Date: Wed, 24 Jan 2024 12:20:00 +0200 Subject: [PATCH 11/18] pyroscope api init entry point --- qryn_bun.mjs | 3 +++ qryn_node.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/qryn_bun.mjs b/qryn_bun.mjs index 1de674f7..8a094b45 100644 --- a/qryn_bun.mjs +++ b/qryn_bun.mjs @@ -54,6 +54,7 @@ import handlerDelGroup from './lib/handlers/alerts/del_group.js' import handlerDelNS from './lib/handlers/alerts/del_ns.js' import handlerPromGetRules from './lib/handlers/alerts/prom_get_rules.js' import handlerTail from './lib/handlers/tail.js' +import {init as pyroscopeInit } from './pyroscope/pyroscope.js' import { readonly } from './common.js' import DATABASE, { init } from './lib/db/clickhouse.js' @@ -312,6 +313,8 @@ export default async() => { '*': otlpPushProtoParser }) + pyroscopeInit(fastify) + const serveView = fs.existsSync(path.join(__dirname, 'view/index.html')) if (serveView) { app.plug(group(path.join(__dirname, 'view'))); diff --git a/qryn_node.js b/qryn_node.js index aa3cccad..e8053021 100755 --- a/qryn_node.js +++ b/qryn_node.js @@ -440,6 +440,8 @@ let fastify = require('fastify')({ }) } + require('./pyroscope/pyroscope').init(fastify) + // Run API Service fastify.listen( { From 8f52a869efb3032d6d2e3e9e6ce54d9e3e2e7c71 Mon Sep 17 00:00:00 2001 From: akvlad Date: Wed, 24 Jan 2024 13:18:52 +0200 Subject: [PATCH 12/18] cherry-pick the pyroscope folder from the pyroscope branch --- pyroscope/profile_pb.js | 2665 +++++++++++++++++++++++++++++++++ pyroscope/proto/profile.proto | 227 +++ pyroscope/pyroscope.js | 335 +++-- 3 files changed, 3114 insertions(+), 113 deletions(-) create mode 100644 pyroscope/profile_pb.js create mode 100644 pyroscope/proto/profile.proto diff --git a/pyroscope/profile_pb.js b/pyroscope/profile_pb.js new file mode 100644 index 00000000..f174224a --- /dev/null +++ b/pyroscope/profile_pb.js @@ -0,0 +1,2665 @@ +// source: proto/profile.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = + (typeof globalThis !== 'undefined' && globalThis) || + (typeof window !== 'undefined' && window) || + (typeof global !== 'undefined' && global) || + (typeof self !== 'undefined' && self) || + (function () { return this; }).call(null) || + Function('return this')(); + +goog.exportSymbol('proto.perftools.profiles.Function', null, global); +goog.exportSymbol('proto.perftools.profiles.Label', null, global); +goog.exportSymbol('proto.perftools.profiles.Line', null, global); +goog.exportSymbol('proto.perftools.profiles.Location', null, global); +goog.exportSymbol('proto.perftools.profiles.Mapping', null, global); +goog.exportSymbol('proto.perftools.profiles.Profile', null, global); +goog.exportSymbol('proto.perftools.profiles.Sample', null, global); +goog.exportSymbol('proto.perftools.profiles.ValueType', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.perftools.profiles.Profile = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.perftools.profiles.Profile.repeatedFields_, null); +}; +goog.inherits(proto.perftools.profiles.Profile, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.perftools.profiles.Profile.displayName = 'proto.perftools.profiles.Profile'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.perftools.profiles.ValueType = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.perftools.profiles.ValueType, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.perftools.profiles.ValueType.displayName = 'proto.perftools.profiles.ValueType'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.perftools.profiles.Sample = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.perftools.profiles.Sample.repeatedFields_, null); +}; +goog.inherits(proto.perftools.profiles.Sample, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.perftools.profiles.Sample.displayName = 'proto.perftools.profiles.Sample'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.perftools.profiles.Label = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.perftools.profiles.Label, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.perftools.profiles.Label.displayName = 'proto.perftools.profiles.Label'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.perftools.profiles.Mapping = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.perftools.profiles.Mapping, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.perftools.profiles.Mapping.displayName = 'proto.perftools.profiles.Mapping'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.perftools.profiles.Location = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.perftools.profiles.Location.repeatedFields_, null); +}; +goog.inherits(proto.perftools.profiles.Location, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.perftools.profiles.Location.displayName = 'proto.perftools.profiles.Location'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.perftools.profiles.Line = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.perftools.profiles.Line, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.perftools.profiles.Line.displayName = 'proto.perftools.profiles.Line'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.perftools.profiles.Function = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.perftools.profiles.Function, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.perftools.profiles.Function.displayName = 'proto.perftools.profiles.Function'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.perftools.profiles.Profile.repeatedFields_ = [1,2,3,4,5,6,13]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.perftools.profiles.Profile.prototype.toObject = function(opt_includeInstance) { + return proto.perftools.profiles.Profile.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.perftools.profiles.Profile} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Profile.toObject = function(includeInstance, msg) { + var f, obj = { + sampleTypeList: jspb.Message.toObjectList(msg.getSampleTypeList(), + proto.perftools.profiles.ValueType.toObject, includeInstance), + sampleList: jspb.Message.toObjectList(msg.getSampleList(), + proto.perftools.profiles.Sample.toObject, includeInstance), + mappingList: jspb.Message.toObjectList(msg.getMappingList(), + proto.perftools.profiles.Mapping.toObject, includeInstance), + locationList: jspb.Message.toObjectList(msg.getLocationList(), + proto.perftools.profiles.Location.toObject, includeInstance), + functionList: jspb.Message.toObjectList(msg.getFunctionList(), + proto.perftools.profiles.Function.toObject, includeInstance), + stringTableList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, + dropFrames: jspb.Message.getFieldWithDefault(msg, 7, 0), + keepFrames: jspb.Message.getFieldWithDefault(msg, 8, 0), + timeNanos: jspb.Message.getFieldWithDefault(msg, 9, 0), + durationNanos: jspb.Message.getFieldWithDefault(msg, 10, 0), + periodType: (f = msg.getPeriodType()) && proto.perftools.profiles.ValueType.toObject(includeInstance, f), + period: jspb.Message.getFieldWithDefault(msg, 12, 0), + commentList: (f = jspb.Message.getRepeatedField(msg, 13)) == null ? undefined : f, + defaultSampleType: jspb.Message.getFieldWithDefault(msg, 14, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.perftools.profiles.Profile} + */ +proto.perftools.profiles.Profile.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.perftools.profiles.Profile; + return proto.perftools.profiles.Profile.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.perftools.profiles.Profile} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.perftools.profiles.Profile} + */ +proto.perftools.profiles.Profile.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.perftools.profiles.ValueType; + reader.readMessage(value,proto.perftools.profiles.ValueType.deserializeBinaryFromReader); + msg.addSampleType(value); + break; + case 2: + var value = new proto.perftools.profiles.Sample; + reader.readMessage(value,proto.perftools.profiles.Sample.deserializeBinaryFromReader); + msg.addSample(value); + break; + case 3: + var value = new proto.perftools.profiles.Mapping; + reader.readMessage(value,proto.perftools.profiles.Mapping.deserializeBinaryFromReader); + msg.addMapping(value); + break; + case 4: + var value = new proto.perftools.profiles.Location; + reader.readMessage(value,proto.perftools.profiles.Location.deserializeBinaryFromReader); + msg.addLocation(value); + break; + case 5: + var value = new proto.perftools.profiles.Function; + reader.readMessage(value,proto.perftools.profiles.Function.deserializeBinaryFromReader); + msg.addFunction(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.addStringTable(value); + break; + case 7: + var value = /** @type {number} */ (reader.readInt64()); + msg.setDropFrames(value); + break; + case 8: + var value = /** @type {number} */ (reader.readInt64()); + msg.setKeepFrames(value); + break; + case 9: + var value = /** @type {number} */ (reader.readInt64()); + msg.setTimeNanos(value); + break; + case 10: + var value = /** @type {number} */ (reader.readInt64()); + msg.setDurationNanos(value); + break; + case 11: + var value = new proto.perftools.profiles.ValueType; + reader.readMessage(value,proto.perftools.profiles.ValueType.deserializeBinaryFromReader); + msg.setPeriodType(value); + break; + case 12: + var value = /** @type {number} */ (reader.readInt64()); + msg.setPeriod(value); + break; + case 13: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt64() : [reader.readInt64()]); + for (var i = 0; i < values.length; i++) { + msg.addComment(values[i]); + } + break; + case 14: + var value = /** @type {number} */ (reader.readInt64()); + msg.setDefaultSampleType(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.perftools.profiles.Profile.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.perftools.profiles.Profile.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.perftools.profiles.Profile} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Profile.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSampleTypeList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.perftools.profiles.ValueType.serializeBinaryToWriter + ); + } + f = message.getSampleList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.perftools.profiles.Sample.serializeBinaryToWriter + ); + } + f = message.getMappingList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.perftools.profiles.Mapping.serializeBinaryToWriter + ); + } + f = message.getLocationList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.perftools.profiles.Location.serializeBinaryToWriter + ); + } + f = message.getFunctionList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 5, + f, + proto.perftools.profiles.Function.serializeBinaryToWriter + ); + } + f = message.getStringTableList(); + if (f.length > 0) { + writer.writeRepeatedString( + 6, + f + ); + } + f = message.getDropFrames(); + if (f !== 0) { + writer.writeInt64( + 7, + f + ); + } + f = message.getKeepFrames(); + if (f !== 0) { + writer.writeInt64( + 8, + f + ); + } + f = message.getTimeNanos(); + if (f !== 0) { + writer.writeInt64( + 9, + f + ); + } + f = message.getDurationNanos(); + if (f !== 0) { + writer.writeInt64( + 10, + f + ); + } + f = message.getPeriodType(); + if (f != null) { + writer.writeMessage( + 11, + f, + proto.perftools.profiles.ValueType.serializeBinaryToWriter + ); + } + f = message.getPeriod(); + if (f !== 0) { + writer.writeInt64( + 12, + f + ); + } + f = message.getCommentList(); + if (f.length > 0) { + writer.writePackedInt64( + 13, + f + ); + } + f = message.getDefaultSampleType(); + if (f !== 0) { + writer.writeInt64( + 14, + f + ); + } +}; + + +/** + * repeated ValueType sample_type = 1; + * @return {!Array} + */ +proto.perftools.profiles.Profile.prototype.getSampleTypeList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.perftools.profiles.ValueType, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.perftools.profiles.Profile} returns this +*/ +proto.perftools.profiles.Profile.prototype.setSampleTypeList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.perftools.profiles.ValueType=} opt_value + * @param {number=} opt_index + * @return {!proto.perftools.profiles.ValueType} + */ +proto.perftools.profiles.Profile.prototype.addSampleType = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.perftools.profiles.ValueType, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.clearSampleTypeList = function() { + return this.setSampleTypeList([]); +}; + + +/** + * repeated Sample sample = 2; + * @return {!Array} + */ +proto.perftools.profiles.Profile.prototype.getSampleList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.perftools.profiles.Sample, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.perftools.profiles.Profile} returns this +*/ +proto.perftools.profiles.Profile.prototype.setSampleList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.perftools.profiles.Sample=} opt_value + * @param {number=} opt_index + * @return {!proto.perftools.profiles.Sample} + */ +proto.perftools.profiles.Profile.prototype.addSample = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.perftools.profiles.Sample, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.clearSampleList = function() { + return this.setSampleList([]); +}; + + +/** + * repeated Mapping mapping = 3; + * @return {!Array} + */ +proto.perftools.profiles.Profile.prototype.getMappingList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.perftools.profiles.Mapping, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.perftools.profiles.Profile} returns this +*/ +proto.perftools.profiles.Profile.prototype.setMappingList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.perftools.profiles.Mapping=} opt_value + * @param {number=} opt_index + * @return {!proto.perftools.profiles.Mapping} + */ +proto.perftools.profiles.Profile.prototype.addMapping = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.perftools.profiles.Mapping, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.clearMappingList = function() { + return this.setMappingList([]); +}; + + +/** + * repeated Location location = 4; + * @return {!Array} + */ +proto.perftools.profiles.Profile.prototype.getLocationList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.perftools.profiles.Location, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.perftools.profiles.Profile} returns this +*/ +proto.perftools.profiles.Profile.prototype.setLocationList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.perftools.profiles.Location=} opt_value + * @param {number=} opt_index + * @return {!proto.perftools.profiles.Location} + */ +proto.perftools.profiles.Profile.prototype.addLocation = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.perftools.profiles.Location, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.clearLocationList = function() { + return this.setLocationList([]); +}; + + +/** + * repeated Function function = 5; + * @return {!Array} + */ +proto.perftools.profiles.Profile.prototype.getFunctionList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.perftools.profiles.Function, 5)); +}; + + +/** + * @param {!Array} value + * @return {!proto.perftools.profiles.Profile} returns this +*/ +proto.perftools.profiles.Profile.prototype.setFunctionList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 5, value); +}; + + +/** + * @param {!proto.perftools.profiles.Function=} opt_value + * @param {number=} opt_index + * @return {!proto.perftools.profiles.Function} + */ +proto.perftools.profiles.Profile.prototype.addFunction = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.perftools.profiles.Function, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.clearFunctionList = function() { + return this.setFunctionList([]); +}; + + +/** + * repeated string string_table = 6; + * @return {!Array} + */ +proto.perftools.profiles.Profile.prototype.getStringTableList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); +}; + + +/** + * @param {!Array} value + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.setStringTableList = function(value) { + return jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.addStringTable = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.clearStringTableList = function() { + return this.setStringTableList([]); +}; + + +/** + * optional int64 drop_frames = 7; + * @return {number} + */ +proto.perftools.profiles.Profile.prototype.getDropFrames = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.setDropFrames = function(value) { + return jspb.Message.setProto3IntField(this, 7, value); +}; + + +/** + * optional int64 keep_frames = 8; + * @return {number} + */ +proto.perftools.profiles.Profile.prototype.getKeepFrames = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.setKeepFrames = function(value) { + return jspb.Message.setProto3IntField(this, 8, value); +}; + + +/** + * optional int64 time_nanos = 9; + * @return {number} + */ +proto.perftools.profiles.Profile.prototype.getTimeNanos = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.setTimeNanos = function(value) { + return jspb.Message.setProto3IntField(this, 9, value); +}; + + +/** + * optional int64 duration_nanos = 10; + * @return {number} + */ +proto.perftools.profiles.Profile.prototype.getDurationNanos = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.setDurationNanos = function(value) { + return jspb.Message.setProto3IntField(this, 10, value); +}; + + +/** + * optional ValueType period_type = 11; + * @return {?proto.perftools.profiles.ValueType} + */ +proto.perftools.profiles.Profile.prototype.getPeriodType = function() { + return /** @type{?proto.perftools.profiles.ValueType} */ ( + jspb.Message.getWrapperField(this, proto.perftools.profiles.ValueType, 11)); +}; + + +/** + * @param {?proto.perftools.profiles.ValueType|undefined} value + * @return {!proto.perftools.profiles.Profile} returns this +*/ +proto.perftools.profiles.Profile.prototype.setPeriodType = function(value) { + return jspb.Message.setWrapperField(this, 11, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.clearPeriodType = function() { + return this.setPeriodType(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.perftools.profiles.Profile.prototype.hasPeriodType = function() { + return jspb.Message.getField(this, 11) != null; +}; + + +/** + * optional int64 period = 12; + * @return {number} + */ +proto.perftools.profiles.Profile.prototype.getPeriod = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.setPeriod = function(value) { + return jspb.Message.setProto3IntField(this, 12, value); +}; + + +/** + * repeated int64 comment = 13; + * @return {!Array} + */ +proto.perftools.profiles.Profile.prototype.getCommentList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 13)); +}; + + +/** + * @param {!Array} value + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.setCommentList = function(value) { + return jspb.Message.setField(this, 13, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.addComment = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 13, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.clearCommentList = function() { + return this.setCommentList([]); +}; + + +/** + * optional int64 default_sample_type = 14; + * @return {number} + */ +proto.perftools.profiles.Profile.prototype.getDefaultSampleType = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 14, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Profile} returns this + */ +proto.perftools.profiles.Profile.prototype.setDefaultSampleType = function(value) { + return jspb.Message.setProto3IntField(this, 14, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.perftools.profiles.ValueType.prototype.toObject = function(opt_includeInstance) { + return proto.perftools.profiles.ValueType.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.perftools.profiles.ValueType} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.ValueType.toObject = function(includeInstance, msg) { + var f, obj = { + type: jspb.Message.getFieldWithDefault(msg, 1, 0), + unit: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.perftools.profiles.ValueType} + */ +proto.perftools.profiles.ValueType.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.perftools.profiles.ValueType; + return proto.perftools.profiles.ValueType.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.perftools.profiles.ValueType} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.perftools.profiles.ValueType} + */ +proto.perftools.profiles.ValueType.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setType(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setUnit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.perftools.profiles.ValueType.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.perftools.profiles.ValueType.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.perftools.profiles.ValueType} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.ValueType.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getType(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getUnit(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } +}; + + +/** + * optional int64 type = 1; + * @return {number} + */ +proto.perftools.profiles.ValueType.prototype.getType = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.ValueType} returns this + */ +proto.perftools.profiles.ValueType.prototype.setType = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 unit = 2; + * @return {number} + */ +proto.perftools.profiles.ValueType.prototype.getUnit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.ValueType} returns this + */ +proto.perftools.profiles.ValueType.prototype.setUnit = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.perftools.profiles.Sample.repeatedFields_ = [1,2,3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.perftools.profiles.Sample.prototype.toObject = function(opt_includeInstance) { + return proto.perftools.profiles.Sample.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.perftools.profiles.Sample} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Sample.toObject = function(includeInstance, msg) { + var f, obj = { + locationIdList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + valueList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f, + labelList: jspb.Message.toObjectList(msg.getLabelList(), + proto.perftools.profiles.Label.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.perftools.profiles.Sample} + */ +proto.perftools.profiles.Sample.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.perftools.profiles.Sample; + return proto.perftools.profiles.Sample.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.perftools.profiles.Sample} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.perftools.profiles.Sample} + */ +proto.perftools.profiles.Sample.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint64() : [reader.readUint64()]); + for (var i = 0; i < values.length; i++) { + msg.addLocationId(values[i]); + } + break; + case 2: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt64() : [reader.readInt64()]); + for (var i = 0; i < values.length; i++) { + msg.addValue(values[i]); + } + break; + case 3: + var value = new proto.perftools.profiles.Label; + reader.readMessage(value,proto.perftools.profiles.Label.deserializeBinaryFromReader); + msg.addLabel(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.perftools.profiles.Sample.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.perftools.profiles.Sample.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.perftools.profiles.Sample} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Sample.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getLocationIdList(); + if (f.length > 0) { + writer.writePackedUint64( + 1, + f + ); + } + f = message.getValueList(); + if (f.length > 0) { + writer.writePackedInt64( + 2, + f + ); + } + f = message.getLabelList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.perftools.profiles.Label.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated uint64 location_id = 1; + * @return {!Array} + */ +proto.perftools.profiles.Sample.prototype.getLocationIdList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.perftools.profiles.Sample} returns this + */ +proto.perftools.profiles.Sample.prototype.setLocationIdList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.perftools.profiles.Sample} returns this + */ +proto.perftools.profiles.Sample.prototype.addLocationId = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.perftools.profiles.Sample} returns this + */ +proto.perftools.profiles.Sample.prototype.clearLocationIdList = function() { + return this.setLocationIdList([]); +}; + + +/** + * repeated int64 value = 2; + * @return {!Array} + */ +proto.perftools.profiles.Sample.prototype.getValueList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * @param {!Array} value + * @return {!proto.perftools.profiles.Sample} returns this + */ +proto.perftools.profiles.Sample.prototype.setValueList = function(value) { + return jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.perftools.profiles.Sample} returns this + */ +proto.perftools.profiles.Sample.prototype.addValue = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.perftools.profiles.Sample} returns this + */ +proto.perftools.profiles.Sample.prototype.clearValueList = function() { + return this.setValueList([]); +}; + + +/** + * repeated Label label = 3; + * @return {!Array} + */ +proto.perftools.profiles.Sample.prototype.getLabelList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.perftools.profiles.Label, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.perftools.profiles.Sample} returns this +*/ +proto.perftools.profiles.Sample.prototype.setLabelList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.perftools.profiles.Label=} opt_value + * @param {number=} opt_index + * @return {!proto.perftools.profiles.Label} + */ +proto.perftools.profiles.Sample.prototype.addLabel = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.perftools.profiles.Label, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.perftools.profiles.Sample} returns this + */ +proto.perftools.profiles.Sample.prototype.clearLabelList = function() { + return this.setLabelList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.perftools.profiles.Label.prototype.toObject = function(opt_includeInstance) { + return proto.perftools.profiles.Label.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.perftools.profiles.Label} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Label.toObject = function(includeInstance, msg) { + var f, obj = { + key: jspb.Message.getFieldWithDefault(msg, 1, 0), + str: jspb.Message.getFieldWithDefault(msg, 2, 0), + num: jspb.Message.getFieldWithDefault(msg, 3, 0), + numUnit: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.perftools.profiles.Label} + */ +proto.perftools.profiles.Label.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.perftools.profiles.Label; + return proto.perftools.profiles.Label.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.perftools.profiles.Label} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.perftools.profiles.Label} + */ +proto.perftools.profiles.Label.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setKey(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStr(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNum(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setNumUnit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.perftools.profiles.Label.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.perftools.profiles.Label.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.perftools.profiles.Label} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Label.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getStr(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getNum(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getNumUnit(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * optional int64 key = 1; + * @return {number} + */ +proto.perftools.profiles.Label.prototype.getKey = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Label} returns this + */ +proto.perftools.profiles.Label.prototype.setKey = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 str = 2; + * @return {number} + */ +proto.perftools.profiles.Label.prototype.getStr = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Label} returns this + */ +proto.perftools.profiles.Label.prototype.setStr = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 num = 3; + * @return {number} + */ +proto.perftools.profiles.Label.prototype.getNum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Label} returns this + */ +proto.perftools.profiles.Label.prototype.setNum = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 num_unit = 4; + * @return {number} + */ +proto.perftools.profiles.Label.prototype.getNumUnit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Label} returns this + */ +proto.perftools.profiles.Label.prototype.setNumUnit = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.perftools.profiles.Mapping.prototype.toObject = function(opt_includeInstance) { + return proto.perftools.profiles.Mapping.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.perftools.profiles.Mapping} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Mapping.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, 0), + memoryStart: jspb.Message.getFieldWithDefault(msg, 2, 0), + memoryLimit: jspb.Message.getFieldWithDefault(msg, 3, 0), + fileOffset: jspb.Message.getFieldWithDefault(msg, 4, 0), + filename: jspb.Message.getFieldWithDefault(msg, 5, 0), + buildId: jspb.Message.getFieldWithDefault(msg, 6, 0), + hasFunctions: jspb.Message.getBooleanFieldWithDefault(msg, 7, false), + hasFilenames: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), + hasLineNumbers: jspb.Message.getBooleanFieldWithDefault(msg, 9, false), + hasInlineFrames: jspb.Message.getBooleanFieldWithDefault(msg, 10, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.perftools.profiles.Mapping} + */ +proto.perftools.profiles.Mapping.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.perftools.profiles.Mapping; + return proto.perftools.profiles.Mapping.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.perftools.profiles.Mapping} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.perftools.profiles.Mapping} + */ +proto.perftools.profiles.Mapping.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setMemoryStart(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setMemoryLimit(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint64()); + msg.setFileOffset(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFilename(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt64()); + msg.setBuildId(value); + break; + case 7: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasFunctions(value); + break; + case 8: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasFilenames(value); + break; + case 9: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasLineNumbers(value); + break; + case 10: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasInlineFrames(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.perftools.profiles.Mapping.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.perftools.profiles.Mapping.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.perftools.profiles.Mapping} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Mapping.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getMemoryStart(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } + f = message.getMemoryLimit(); + if (f !== 0) { + writer.writeUint64( + 3, + f + ); + } + f = message.getFileOffset(); + if (f !== 0) { + writer.writeUint64( + 4, + f + ); + } + f = message.getFilename(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } + f = message.getBuildId(); + if (f !== 0) { + writer.writeInt64( + 6, + f + ); + } + f = message.getHasFunctions(); + if (f) { + writer.writeBool( + 7, + f + ); + } + f = message.getHasFilenames(); + if (f) { + writer.writeBool( + 8, + f + ); + } + f = message.getHasLineNumbers(); + if (f) { + writer.writeBool( + 9, + f + ); + } + f = message.getHasInlineFrames(); + if (f) { + writer.writeBool( + 10, + f + ); + } +}; + + +/** + * optional uint64 id = 1; + * @return {number} + */ +proto.perftools.profiles.Mapping.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Mapping} returns this + */ +proto.perftools.profiles.Mapping.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint64 memory_start = 2; + * @return {number} + */ +proto.perftools.profiles.Mapping.prototype.getMemoryStart = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Mapping} returns this + */ +proto.perftools.profiles.Mapping.prototype.setMemoryStart = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional uint64 memory_limit = 3; + * @return {number} + */ +proto.perftools.profiles.Mapping.prototype.getMemoryLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Mapping} returns this + */ +proto.perftools.profiles.Mapping.prototype.setMemoryLimit = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional uint64 file_offset = 4; + * @return {number} + */ +proto.perftools.profiles.Mapping.prototype.getFileOffset = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Mapping} returns this + */ +proto.perftools.profiles.Mapping.prototype.setFileOffset = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional int64 filename = 5; + * @return {number} + */ +proto.perftools.profiles.Mapping.prototype.getFilename = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Mapping} returns this + */ +proto.perftools.profiles.Mapping.prototype.setFilename = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + +/** + * optional int64 build_id = 6; + * @return {number} + */ +proto.perftools.profiles.Mapping.prototype.getBuildId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Mapping} returns this + */ +proto.perftools.profiles.Mapping.prototype.setBuildId = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); +}; + + +/** + * optional bool has_functions = 7; + * @return {boolean} + */ +proto.perftools.profiles.Mapping.prototype.getHasFunctions = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 7, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.perftools.profiles.Mapping} returns this + */ +proto.perftools.profiles.Mapping.prototype.setHasFunctions = function(value) { + return jspb.Message.setProto3BooleanField(this, 7, value); +}; + + +/** + * optional bool has_filenames = 8; + * @return {boolean} + */ +proto.perftools.profiles.Mapping.prototype.getHasFilenames = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.perftools.profiles.Mapping} returns this + */ +proto.perftools.profiles.Mapping.prototype.setHasFilenames = function(value) { + return jspb.Message.setProto3BooleanField(this, 8, value); +}; + + +/** + * optional bool has_line_numbers = 9; + * @return {boolean} + */ +proto.perftools.profiles.Mapping.prototype.getHasLineNumbers = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.perftools.profiles.Mapping} returns this + */ +proto.perftools.profiles.Mapping.prototype.setHasLineNumbers = function(value) { + return jspb.Message.setProto3BooleanField(this, 9, value); +}; + + +/** + * optional bool has_inline_frames = 10; + * @return {boolean} + */ +proto.perftools.profiles.Mapping.prototype.getHasInlineFrames = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.perftools.profiles.Mapping} returns this + */ +proto.perftools.profiles.Mapping.prototype.setHasInlineFrames = function(value) { + return jspb.Message.setProto3BooleanField(this, 10, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.perftools.profiles.Location.repeatedFields_ = [4]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.perftools.profiles.Location.prototype.toObject = function(opt_includeInstance) { + return proto.perftools.profiles.Location.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.perftools.profiles.Location} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Location.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, 0), + mappingId: jspb.Message.getFieldWithDefault(msg, 2, 0), + address: jspb.Message.getFieldWithDefault(msg, 3, 0), + lineList: jspb.Message.toObjectList(msg.getLineList(), + proto.perftools.profiles.Line.toObject, includeInstance), + isFolded: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.perftools.profiles.Location} + */ +proto.perftools.profiles.Location.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.perftools.profiles.Location; + return proto.perftools.profiles.Location.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.perftools.profiles.Location} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.perftools.profiles.Location} + */ +proto.perftools.profiles.Location.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setMappingId(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setAddress(value); + break; + case 4: + var value = new proto.perftools.profiles.Line; + reader.readMessage(value,proto.perftools.profiles.Line.deserializeBinaryFromReader); + msg.addLine(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsFolded(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.perftools.profiles.Location.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.perftools.profiles.Location.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.perftools.profiles.Location} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Location.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getMappingId(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } + f = message.getAddress(); + if (f !== 0) { + writer.writeUint64( + 3, + f + ); + } + f = message.getLineList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.perftools.profiles.Line.serializeBinaryToWriter + ); + } + f = message.getIsFolded(); + if (f) { + writer.writeBool( + 5, + f + ); + } +}; + + +/** + * optional uint64 id = 1; + * @return {number} + */ +proto.perftools.profiles.Location.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Location} returns this + */ +proto.perftools.profiles.Location.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint64 mapping_id = 2; + * @return {number} + */ +proto.perftools.profiles.Location.prototype.getMappingId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Location} returns this + */ +proto.perftools.profiles.Location.prototype.setMappingId = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional uint64 address = 3; + * @return {number} + */ +proto.perftools.profiles.Location.prototype.getAddress = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Location} returns this + */ +proto.perftools.profiles.Location.prototype.setAddress = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * repeated Line line = 4; + * @return {!Array} + */ +proto.perftools.profiles.Location.prototype.getLineList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.perftools.profiles.Line, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.perftools.profiles.Location} returns this +*/ +proto.perftools.profiles.Location.prototype.setLineList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.perftools.profiles.Line=} opt_value + * @param {number=} opt_index + * @return {!proto.perftools.profiles.Line} + */ +proto.perftools.profiles.Location.prototype.addLine = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.perftools.profiles.Line, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.perftools.profiles.Location} returns this + */ +proto.perftools.profiles.Location.prototype.clearLineList = function() { + return this.setLineList([]); +}; + + +/** + * optional bool is_folded = 5; + * @return {boolean} + */ +proto.perftools.profiles.Location.prototype.getIsFolded = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.perftools.profiles.Location} returns this + */ +proto.perftools.profiles.Location.prototype.setIsFolded = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.perftools.profiles.Line.prototype.toObject = function(opt_includeInstance) { + return proto.perftools.profiles.Line.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.perftools.profiles.Line} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Line.toObject = function(includeInstance, msg) { + var f, obj = { + functionId: jspb.Message.getFieldWithDefault(msg, 1, 0), + line: jspb.Message.getFieldWithDefault(msg, 2, 0), + column: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.perftools.profiles.Line} + */ +proto.perftools.profiles.Line.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.perftools.profiles.Line; + return proto.perftools.profiles.Line.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.perftools.profiles.Line} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.perftools.profiles.Line} + */ +proto.perftools.profiles.Line.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setFunctionId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setLine(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setColumn(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.perftools.profiles.Line.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.perftools.profiles.Line.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.perftools.profiles.Line} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Line.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFunctionId(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getLine(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getColumn(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } +}; + + +/** + * optional uint64 function_id = 1; + * @return {number} + */ +proto.perftools.profiles.Line.prototype.getFunctionId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Line} returns this + */ +proto.perftools.profiles.Line.prototype.setFunctionId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 line = 2; + * @return {number} + */ +proto.perftools.profiles.Line.prototype.getLine = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Line} returns this + */ +proto.perftools.profiles.Line.prototype.setLine = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 column = 3; + * @return {number} + */ +proto.perftools.profiles.Line.prototype.getColumn = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Line} returns this + */ +proto.perftools.profiles.Line.prototype.setColumn = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.perftools.profiles.Function.prototype.toObject = function(opt_includeInstance) { + return proto.perftools.profiles.Function.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.perftools.profiles.Function} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Function.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, 0), + name: jspb.Message.getFieldWithDefault(msg, 2, 0), + systemName: jspb.Message.getFieldWithDefault(msg, 3, 0), + filename: jspb.Message.getFieldWithDefault(msg, 4, 0), + startLine: jspb.Message.getFieldWithDefault(msg, 5, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.perftools.profiles.Function} + */ +proto.perftools.profiles.Function.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.perftools.profiles.Function; + return proto.perftools.profiles.Function.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.perftools.profiles.Function} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.perftools.profiles.Function} + */ +proto.perftools.profiles.Function.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt64()); + msg.setName(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setSystemName(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setFilename(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStartLine(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.perftools.profiles.Function.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.perftools.profiles.Function.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.perftools.profiles.Function} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.perftools.profiles.Function.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getName(); + if (f !== 0) { + writer.writeInt64( + 2, + f + ); + } + f = message.getSystemName(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getFilename(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getStartLine(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } +}; + + +/** + * optional uint64 id = 1; + * @return {number} + */ +proto.perftools.profiles.Function.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Function} returns this + */ +proto.perftools.profiles.Function.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int64 name = 2; + * @return {number} + */ +proto.perftools.profiles.Function.prototype.getName = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Function} returns this + */ +proto.perftools.profiles.Function.prototype.setName = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 system_name = 3; + * @return {number} + */ +proto.perftools.profiles.Function.prototype.getSystemName = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Function} returns this + */ +proto.perftools.profiles.Function.prototype.setSystemName = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 filename = 4; + * @return {number} + */ +proto.perftools.profiles.Function.prototype.getFilename = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Function} returns this + */ +proto.perftools.profiles.Function.prototype.setFilename = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional int64 start_line = 5; + * @return {number} + */ +proto.perftools.profiles.Function.prototype.getStartLine = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.perftools.profiles.Function} returns this + */ +proto.perftools.profiles.Function.prototype.setStartLine = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + +goog.object.extend(exports, proto.perftools.profiles); diff --git a/pyroscope/proto/profile.proto b/pyroscope/proto/profile.proto new file mode 100644 index 00000000..ff987a61 --- /dev/null +++ b/pyroscope/proto/profile.proto @@ -0,0 +1,227 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Profile is a common stacktrace profile format. +// +// Measurements represented with this format should follow the +// following conventions: +// +// - Consumers should treat unset optional fields as if they had been +// set with their default value. +// +// - When possible, measurements should be stored in "unsampled" form +// that is most useful to humans. There should be enough +// information present to determine the original sampled values. +// +// - On-disk, the serialized proto must be gzip-compressed. +// +// - The profile is represented as a set of samples, where each sample +// references a sequence of locations, and where each location belongs +// to a mapping. +// - There is a N->1 relationship from sample.location_id entries to +// locations. For every sample.location_id entry there must be a +// unique Location with that id. +// - There is an optional N->1 relationship from locations to +// mappings. For every nonzero Location.mapping_id there must be a +// unique Mapping with that id. + +syntax = "proto3"; + +package perftools.profiles; + +option java_package = "com.google.perftools.profiles"; +option java_outer_classname = "ProfileProto"; + +message Profile { + // A description of the samples associated with each Sample.value. + // For a cpu profile this might be: + // [["cpu","nanoseconds"]] or [["wall","seconds"]] or [["syscall","count"]] + // For a heap profile, this might be: + // [["allocations","count"], ["space","bytes"]], + // If one of the values represents the number of events represented + // by the sample, by convention it should be at index 0 and use + // sample_type.unit == "count". + repeated ValueType sample_type = 1; + // The set of samples recorded in this profile. + repeated Sample sample = 2; + // Mapping from address ranges to the image/binary/library mapped + // into that address range. mapping[0] will be the main binary. + repeated Mapping mapping = 3; + // Locations referenced by samples. + repeated Location location = 4; + // Functions referenced by locations. + repeated Function function = 5; + // A common table for strings referenced by various messages. + // string_table[0] must always be "". + repeated string string_table = 6; + // frames with Function.function_name fully matching the following + // regexp will be dropped from the samples, along with their successors. + int64 drop_frames = 7; // Index into string table. + // frames with Function.function_name fully matching the following + // regexp will be kept, even if it matches drop_frames. + int64 keep_frames = 8; // Index into string table. + + // The following fields are informational, do not affect + // interpretation of results. + + // Time of collection (UTC) represented as nanoseconds past the epoch. + int64 time_nanos = 9; + // Duration of the profile, if a duration makes sense. + int64 duration_nanos = 10; + // The kind of events between sampled occurrences. + // e.g [ "cpu","cycles" ] or [ "heap","bytes" ] + ValueType period_type = 11; + // The number of events between sampled occurrences. + int64 period = 12; + // Free-form text associated with the profile. The text is displayed as is + // to the user by the tools that read profiles (e.g. by pprof). This field + // should not be used to store any machine-readable information, it is only + // for human-friendly content. The profile must stay functional if this field + // is cleaned. + repeated int64 comment = 13; // Indices into string table. + // Index into the string table of the type of the preferred sample + // value. If unset, clients should default to the last sample value. + int64 default_sample_type = 14; +} + +// ValueType describes the semantics and measurement units of a value. +message ValueType { + int64 type = 1; // Index into string table. + int64 unit = 2; // Index into string table. +} + +// Each Sample records values encountered in some program +// context. The program context is typically a stack trace, perhaps +// augmented with auxiliary information like the thread-id, some +// indicator of a higher level request being handled etc. +message Sample { + // The ids recorded here correspond to a Profile.location.id. + // The leaf is at location_id[0]. + repeated uint64 location_id = 1; + // The type and unit of each value is defined by the corresponding + // entry in Profile.sample_type. All samples must have the same + // number of values, the same as the length of Profile.sample_type. + // When aggregating multiple samples into a single sample, the + // result has a list of values that is the element-wise sum of the + // lists of the originals. + repeated int64 value = 2; + // label includes additional context for this sample. It can include + // things like a thread id, allocation size, etc. + // + // NOTE: While possible, having multiple values for the same label key is + // strongly discouraged and should never be used. Most tools (e.g. pprof) do + // not have good (or any) support for multi-value labels. And an even more + // discouraged case is having a string label and a numeric label of the same + // name on a sample. Again, possible to express, but should not be used. + repeated Label label = 3; +} + +message Label { + // Index into string table. An annotation for a sample (e.g. + // "allocation_size") with an associated value. + // Keys with "pprof::" prefix are reserved for internal use by pprof. + int64 key = 1; + + // At most one of the following must be present + int64 str = 2; // Index into string table + int64 num = 3; + + // Should only be present when num is present. + // Specifies the units of num. + // Use arbitrary string (for example, "requests") as a custom count unit. + // If no unit is specified, consumer may apply heuristic to deduce the unit. + // Consumers may also interpret units like "bytes" and "kilobytes" as memory + // units and units like "seconds" and "nanoseconds" as time units, + // and apply appropriate unit conversions to these. + int64 num_unit = 4; // Index into string table +} + +message Mapping { + // Unique nonzero id for the mapping. + uint64 id = 1; + // Address at which the binary (or DLL) is loaded into memory. + uint64 memory_start = 2; + // The limit of the address range occupied by this mapping. + uint64 memory_limit = 3; + // Offset in the binary that corresponds to the first mapped address. + uint64 file_offset = 4; + // The object this entry is loaded from. This can be a filename on + // disk for the main binary and shared libraries, or virtual + // abstractions like "[vdso]". + int64 filename = 5; // Index into string table + // A string that uniquely identifies a particular program version + // with high probability. E.g., for binaries generated by GNU tools, + // it could be the contents of the .note.gnu.build-id field. + int64 build_id = 6; // Index into string table + + // The following fields indicate the resolution of symbolic info. + bool has_functions = 7; + bool has_filenames = 8; + bool has_line_numbers = 9; + bool has_inline_frames = 10; +} + +// Describes function and line table debug information. +message Location { + // Unique nonzero id for the location. A profile could use + // instruction addresses or any integer sequence as ids. + uint64 id = 1; + // The id of the corresponding profile.Mapping for this location. + // It can be unset if the mapping is unknown or not applicable for + // this profile type. + uint64 mapping_id = 2; + // The instruction address for this location, if available. It + // should be within [Mapping.memory_start...Mapping.memory_limit] + // for the corresponding mapping. A non-leaf address may be in the + // middle of a call instruction. It is up to display tools to find + // the beginning of the instruction if necessary. + uint64 address = 3; + // Multiple line indicates this location has inlined functions, + // where the last entry represents the caller into which the + // preceding entries were inlined. + // + // E.g., if memcpy() is inlined into printf: + // line[0].function_name == "memcpy" + // line[1].function_name == "printf" + repeated Line line = 4; + // Provides an indication that multiple symbols map to this location's + // address, for example due to identical code folding by the linker. In that + // case the line information above represents one of the multiple + // symbols. This field must be recomputed when the symbolization state of the + // profile changes. + bool is_folded = 5; +} + +message Line { + // The id of the corresponding profile.Function for this line. + uint64 function_id = 1; + // Line number in source code. + int64 line = 2; + // Column number in source code. + int64 column = 3; +} + +message Function { + // Unique nonzero id for the function. + uint64 id = 1; + // Name of the function, in human-readable form if available. + int64 name = 2; // Index into string table + // Name of the function, as identified by the system. + // For instance, it can be a C++ mangled name. + int64 system_name = 3; // Index into string table + // Source file containing the function. + int64 filename = 4; // Index into string table + // Line number in source file. + int64 start_line = 5; +} diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js index 2c5ba2ce..26c01d84 100644 --- a/pyroscope/pyroscope.js +++ b/pyroscope/pyroscope.js @@ -4,13 +4,21 @@ const services = require('./querier_grpc_pb') const clickhouse = require('../lib/db/clickhouse') const { DATABASE_NAME } = require('../lib/utils') const Sql = require('@cloki/clickhouse-sql') -const { pyroscopeSelectMergeStacktraces } = require('../wasm_parts/main') const compiler = require('../parser/bnf') +const { readULeb32 } = require('./pprof') +const pprofBin = require('./pprof-bin/pkg/pprof_bin') +const { QrynBadRequest } = require('../lib/handlers/errors') + +const HISTORY_TIMESPAN = 1000 * 60 * 60 * 24 * 7 const profileTypesHandler = async (req, res) => { const _res = new messages.ProfileTypesResponse() - const fromTimeSec = req.body ? parseInt(req.body.getStart()) / 1000 : (Date.now() - 1000 * 60 * 60 * 48) / 1000 - const toTimeSec = req.body ? parseInt(req.body.getEnd()) / 1000 : Date.now() / 1000 + const fromTimeSec = req.body && req.body.getStart + ? parseInt(req.body.getStart()) / 1000 + : (Date.now() - HISTORY_TIMESPAN) / 1000 + const toTimeSec = req.body && req.body.getEnd + ? parseInt(req.body.getEnd()) / 1000 + : Date.now() / 1000 const profileTypes = await clickhouse.rawRequest(`SELECT DISTINCT type_id, sample_type_unit FROM profiles_series ARRAY JOIN sample_types_units as sample_type_unit WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, @@ -26,27 +34,33 @@ WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDa pt.setPeriodUnit(periodUnit) return pt })) - return res.code(200).send(_res.serializeBinary()) + return res.code(200).send(Buffer.from(_res.serializeBinary())) } const labelNames = async (req, res) => { - const fromTimeSec = req.body ? parseInt(req.body.getStart()) / 1000 : (Date.now() - 1000 * 60 * 60 * 48) / 1000 - const toTimeSec = req.body ? parseInt(req.body.getEnd()) / 1000 : Date.now() / 1000 + const fromTimeSec = req.body && req.body.getStart + ? parseInt(req.body.getStart()) / 1000 + : (Date.now() - HISTORY_TIMESPAN) / 1000 + const toTimeSec = req.body && req.body.getEnd + ? parseInt(req.body.getEnd()) / 1000 + : Date.now() / 1000 const labelNames = await clickhouse.rawRequest(`SELECT DISTINCT key FROM profiles_series_keys WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, null, DATABASE_NAME()) const resp = new types.LabelNamesResponse() resp.setNamesList(labelNames.data.data.map(label => label.key)) - return res.code(200).send(resp.serializeBinary()) + return res.code(200).send(Buffer.from(resp.serializeBinary())) } const labelValues = async (req, res) => { - const name = req.body ? req.body.getName() : '' - const fromTimeSec = req.body && req.body.getStart() + const name = req.body && req.body.getName + ? req.body.getName() + : '' + const fromTimeSec = req.body && req.body.getStart && req.body.getStart() ? parseInt(req.body.getStart()) / 1000 - : (Date.now() - 1000 * 60 * 60 * 48) / 1000 - const toTimeSec = req.body && req.body.getEnd() + : (Date.now() - HISTORY_TIMESPAN) / 1000 + const toTimeSec = req.body && req.body.getEnd && req.body.getEnd() ? parseInt(req.body.getEnd()) / 1000 : Date.now() / 1000 if (!name) { @@ -59,7 +73,7 @@ date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, null, DATABASE_NAME()) const resp = new types.LabelValuesResponse() resp.setNamesList(labelValues.data.data.map(label => label.val)) - return res.code(200).send(resp.serializeBinary()) + return res.code(200).send(Buffer.from(resp.serializeBinary())) } const parser = (MsgClass) => { @@ -84,17 +98,59 @@ const parser = (MsgClass) => { } } +let ctxIdx = 0 + +/** + * + * @param {Sql.Select} query + * @param {string} labelSelector + */ +const labelSelectorQuery = (query, labelSelector) => { + if (!labelSelector || !labelSelector.length || labelSelector === '{}') { + return query + } + const labelSelectorScript = compiler.ParseScript(labelSelector).rootToken + const labelsConds = [] + for (const rule of labelSelectorScript.Children('log_stream_selector_rule')) { + const val = JSON.parse(rule.Child('quoted_str').value) + let valRul = null + switch (rule.Child('operator').value) { + case '=': + valRul = Sql.Eq(new Sql.Raw('val'), Sql.val(val)) + break + case '!=': + valRul = Sql.Ne(new Sql.Raw('val'), Sql.val(val)) + break + case '=~': + valRul = Sql.Eq(`match(val, ${Sql.quoteVal(val)})`, 1) + break + case '!~': + valRul = Sql.Ne(`match(val, ${Sql.quoteVal(val)})`, 1) + } + const labelSubCond = Sql.And( + Sql.Eq('key', Sql.val(rule.Child('label').value)), + valRul + ) + labelsConds.push(labelSubCond) + } + query.where(Sql.Or(...labelsConds)) + query.having(Sql.Eq( + new Sql.Raw(labelsConds.map((cond, i) => { + return `bitShiftLeft(toUInt64(${cond}), ${i})` + }).join('+')), + new Sql.Raw(`bitShiftLeft(toUInt64(1), ${labelsConds.length})-1`) + )) +} + const selectMergeStacktraces = async (req, res) => { - console.log(`selectMergeStacktraces ${req.body}`) const typeRe = req.body.getProfileTypeid().match(/^(.+):([^:]+):([^:]+)$/) const sel = req.body.getLabelSelector() const fromTimeSec = req.body && req.body.getStart() - ? parseInt(req.body.getStart()) / 1000 - : (Date.now() - 1000 * 60 * 60 * 48) / 1000 + ? Math.floor(parseInt(req.body.getStart()) / 1000) + : Math.floor((Date.now() - 1000 * 60 * 60 * 48) / 1000) const toTimeSec = req.body && req.body.getEnd() - ? parseInt(req.body.getEnd()) / 1000 - : Date.now() / 1000 - const query = sel ? compiler.ParseScript(sel).rootToken : null; + ? Math.floor(parseInt(req.body.getEnd()) / 1000) + : Math.floor(Date.now() / 1000) const idxSelect = (new Sql.Select()) .select('fingerprint') .from('profiles_series_gin') @@ -106,24 +162,7 @@ const selectMergeStacktraces = async (req, res) => { Sql.Lte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)}))`)) ) ).groupBy('fingerprint') - if (query) { - const labelsConds = [] - for (const rule of query.Children('log_stream_selector_rule')) { - const val = JSON.parse(rule.Child('quoted_str').value) - const labelSubCond = Sql.And( - Sql.Eq('key', Sql.val(rule.Child('label').value)), - Sql.Eq('val', Sql.val(val)) - ) - labelsConds.push(labelSubCond) - } - idxSelect.where(Sql.Or(...labelsConds)) - idxSelect.having(Sql.Eq( - new Sql.Raw(labelsConds.map((cond, i) => { - return `bitShiftLeft(toUInt64(${cond}), ${i})` - }).join('+')), - new Sql.Raw(`bitShiftLeft(toUInt64(1), ${labelsConds.length})-1`) - )) - } + labelSelectorQuery(idxSelect, sel) const sqlReq = (new Sql.Select()) .select('payload') .from('profiles') @@ -133,48 +172,159 @@ const selectMergeStacktraces = async (req, res) => { Sql.Lte('timestamp_ns', new Sql.Raw(Math.floor(toTimeSec) + '000000000')), new Sql.In('fingerprint', 'IN', idxSelect) )) - let start = Date.now() const profiles = await clickhouse.rawRequest(sqlReq.toString() + 'FORMAT RowBinary', null, DATABASE_NAME(), { responseType: 'arraybuffer' }) - console.log(`got ${profiles.data.length} bytes in ${Date.now() - start} ms`) - start = Date.now() - const _res = profiles.data.length !== 0 - ? pyroscopeSelectMergeStacktraces(Uint8Array.from(profiles.data)) - : { names: [], total: 0, maxSelf: 0, levels: [] } - console.log(`processed ${profiles.data.length} bytes in ${Date.now() - start} ms`) - const resp = new messages.SelectMergeStacktracesResponse() - const fg = new messages.FlameGraph() - fg.setNamesList(_res.names) - fg.setTotal(_res.total) - fg.setMaxSelf(_res.maxSelf) - fg.setLevelsList(_res.levels.map(l => { - const level = new messages.Level() - level.setValuesList(l) - return level - })) - resp.setFlamegraph(fg) - return res.code(200).send(resp.serializeBinary()) - /* -message SelectMergeStacktracesResponse { - FlameGraph flamegraph = 1; -} -message FlameGraph { - repeated string names = 1; - repeated Level levels = 2; - int64 total = 3; - int64 max_self = 4; -} -message Level { - repeated int64 values = 1; -} - */ + const binData = Uint8Array.from(profiles.data) + require('./pprof-bin/pkg/pprof_bin').init_panic_hook() + const promises = [] + const _ctxIdx = ++ctxIdx + for (let i = 0; i < binData.length;) { + const [size, shift] = readULeb32(binData, i) + const uarray = Uint8Array.from(profiles.data.slice(i + shift, i + size + shift)) + i += size + shift + promises.push(new Promise((resolve, reject) => setTimeout(() => { + try { + pprofBin.merge_tree(_ctxIdx, uarray, `${typeRe[2]}:${typeRe[3]}`) + resolve() + } catch (e) { + reject(e) + } + }, 0))) + } + let sResp = null + try { + await Promise.all(promises) + sResp = pprofBin.export_tree(_ctxIdx) + } finally { + try { pprofBin.drop_tree(_ctxIdx) } catch (e) { req.log.error(e) } + } + return res.code(200).send(Buffer.from(sResp)) } -const selectSeries = (req, res) => { +const selectSeries = async (req, res) => { + const _req = req.body + const fromTimeSec = Math.floor(req.getStart && req.getStart() + ? parseInt(req.getStart()) / 1000 + : Date.now() / 1000 - HISTORY_TIMESPAN) + const toTimeSec = Math.floor(req.getEnd && req.getEnd() + ? parseInt(req.getEnd()) / 1000 + : Date.now() / 1000) + let typeId = _req.getProfileTypeid && _req.getProfileTypeid() + if (!typeId) { + throw new QrynBadRequest('No type provided') + } + typeId = typeId.match(/^(.+):([^:]+):([^:]+)$/) + if (!typeId) { + throw new QrynBadRequest('Invalid type provided') + } + const sampleTypeId = typeId[2] + ':' + typeId[3] + const labelSelector = _req.getLabelSelector && _req.getLabelSelector() + let groupBy = _req.getGroupByList && _req.getGroupByList() + groupBy = groupBy && groupBy.length ? groupBy : null + const step = _req.getStep && parseInt(_req.getStep()) + if (!step || isNaN(step)) { + throw new QrynBadRequest('No step provided') + } + const aggregation = _req.getAggregation && _req.getAggregation() + + const idxReq = (new Sql.Select()) + .select(new Sql.Raw('fingerprint')) + .from('profiles_series_gin') + .where( + Sql.And( + Sql.Eq('type_id', Sql.val(typeId[1])), + Sql.Gte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)}))`)), + Sql.Lte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)}))`)), + Sql.Eq(new Sql.Raw( + `has(sample_types_units, (${Sql.quoteVal(typeId[2])}, ${Sql.quoteVal(typeId[3])}))`), + 1) + ) + ) + labelSelectorQuery(idxReq, labelSelector) + + const withIdxReq = (new Sql.With('idx', idxReq, false)) + + let tagsReq = 'arraySort(p.tags)' + if (groupBy) { + tagsReq = `arraySort(arrayFilter(x -> x in (${groupBy.map(g => Sql.quoteVal(g)).join(',')}), p.tags))` + } + + const labelsReq = (new Sql.Select()).with(withIdxReq).select( + 'fingerprint', + [new Sql.Raw(tagsReq), 'tags'], + [groupBy ? 'fingerprint' : new Sql.Raw('cityHash64(tags)'), 'new_fingerprint'] + ).distinct(true).from(['profiles_series', 'p']) + .where(Sql.And( + new Sql.In('fingerprint', 'IN', new Sql.WithReference(withIdxReq)), + Sql.Gte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)}))`)), + Sql.Lte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)}))`)) + )) + + const withLabelsReq = new Sql.With('labels', labelsReq, false) + + let valueCol = new Sql.Raw( + `sum(toFloat64(arrayFirst(x -> x.1 == ${Sql.quoteVal(sampleTypeId)}, p.values_agg).2))`) + if (aggregation === types.TimeSeriesAggregationType.TIME_SERIES_AGGREGATION_TYPE_AVERAGE) { + valueCol = new Sql.Raw( + `sum(toFloat64(arrayFirst(x -> x.1 == ${Sql.quoteVal(sampleTypeId)}).2, p.values_agg)) / ` + + `sum(toFloat64(arrayFirst(x -> x.1 == ${Sql.quoteVal(sampleTypeId)}).3, p.values_agg))` + ) + } + + const mainReq = (new Sql.Select()).with(withIdxReq, withLabelsReq).select( + [new Sql.Raw(`intDiv(p.timestamp_ns, 1000000000 * ${step}) * ${step} * 1000`), 'timestamp_ms'], + [new Sql.Raw('labels.new_fingerprint'), 'fingerprint'], + [new Sql.Raw('min(labels.tags)'), 'labels'], + [valueCol, 'value'] + ).from(['profiles', 'p']).join( + new Sql.WithReference(withLabelsReq), + 'ANY LEFT', + Sql.Eq(new Sql.Raw('p.fingerprint'), new Sql.Raw('labels.fingerprint')) + ).where( + Sql.And( + new Sql.In('p.fingerprint', 'IN', new Sql.WithReference(withIdxReq)), + Sql.Gte('p.timestamp_ns', new Sql.Raw(`${fromTimeSec}000000000`)), + Sql.Lt('p.timestamp_ns', new Sql.Raw(`${toTimeSec}000000000`)) + ) + ).groupBy('timestamp_ns', 'fingerprint') + .orderBy(['fingerprint', 'ASC'], ['timestamp_ns', 'ASC']) + const strMainReq = mainReq.toString() + console.log(strMainReq) + const chRes = await clickhouse + .rawRequest(strMainReq + ' FORMAT JSON', null, DATABASE_NAME()) + + let lastFingerprint = null + const seriesList = [] + let lastSeries = null + let lastPoints = [] + for (let i = 0; i < chRes.data.data.length; i++) { + const e = chRes.data.data[i] + if (lastFingerprint !== e.fingerprint) { + lastFingerprint = e.fingerprint + lastSeries && lastSeries.setPointsList(lastPoints) + lastSeries && seriesList.push(lastSeries) + lastPoints = [] + lastSeries = new types.Series() + lastSeries.setLabelsList(e.labels.map(l => { + const lp = new types.LabelPair() + lp.setName(l[0]) + lp.setValue(l[1]) + return lp + })) + } + + const p = new types.Point() + p.setValue(e.value) + p.setTimestamp(e.timestamp_ms) + lastPoints.push(p) + } + lastSeries && lastSeries.setPointsList(lastPoints) + lastSeries && seriesList.push(lastSeries) + const resp = new messages.SelectSeriesResponse() - resp.setSeriesList([]) - return res.code(200).send(resp.serializeBinary()) + resp.setSeriesList(seriesList) + return res.code(200).send(Buffer.from(resp.serializeBinary())) } module.exports.init = (fastify) => { @@ -192,45 +342,4 @@ module.exports.init = (fastify) => { '*': parser(services.QuerierServiceService[name].requestType) }) } -// create a grpc server from services.QuerierServiceService - /*const server = new grpc.Server(); - server.addService(services.QuerierServiceService, { - ProfileTypes: , - LabelValues: (call, cb) => { - - }, - // (types.v1.LabelNamesRequest) returns (types.v1.LabelNamesResponse) {} - LabelNames: (call, cb) => { - - }, - // (SeriesRequest) returns (SeriesResponse) {} - Series: (call, cb) => { - - }, - // SelectMergeStacktraces returns matching profiles aggregated in a flamegraph format. It will combine samples from within the same callstack, with each element being grouped by its function name. - // (SelectMergeStacktracesRequest) returns (SelectMergeStacktracesResponse) {} - SelectMergeStacktraces: (call, cb) => { - - }, - // SelectMergeSpans returns matching profiles aggregated in a flamegraph format. It will combine samples from within the same callstack, with each element being grouped by its function name. - // rpc SelectMergeSpanProfile(SelectMergeSpanProfileRequest) returns (SelectMergeSpanProfileResponse) {} - SelectMergeSpanProfile: (call, cb) => { - - }, - // SelectMergeProfile returns matching profiles aggregated in pprof format. It will contain all information stored (so including filenames and line number, if ingested). - // rpc SelectMergeProfile(SelectMergeProfileRequest) returns (google.v1.Profile) {} - SelectMergeProfile: (call, cb) => {}, - // SelectSeries returns a time series for the total sum of the requested profiles. - // rpc SelectSeries(SelectSeriesRequest) returns (SelectSeriesResponse) {} - SelectSeries: (call, cb) => { - - }, - // rpc Diff(DiffRequest) returns (DiffResponse) {} - Diff: (call, cb) => { - - } - }) - server.bindAsync('0.0.0.0:50051', grpc.ServerCredentials.createInsecure(), () => { - server.start() - })*/ } From e081cb0efe1077d445b1d5a246d174d3fc8e294d Mon Sep 17 00:00:00 2001 From: akvlad Date: Wed, 24 Jan 2024 13:29:10 +0200 Subject: [PATCH 13/18] fix conflicts --- package-lock.json | 85 ++++++++++++++++++++++++++++++++++++++++++++--- package.json | 4 ++- 2 files changed, 83 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index e300f42f..4aba4ff2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "@fastify/static": "^6.12.0", "@fastify/url-data": "^5.4.0", "@fastify/websocket": "^8.2.0", + "@grpc/grpc-js": "^1.9.14", "@qxip/influx-line-protocol-parser": "^0.2.1", "@qxip/plugnplay": "^3.3.1", "@stricjs/router": "^5.0.6", @@ -33,6 +34,7 @@ "fastify-metrics": "^10.3.3", "fastify-plugin": "^4.5.1", "glob": "^7.1.2", + "google-protobuf": "^3.21.2", "handlebars": "^4.7.7", "handlebars-helpers": "^0.9.8", "http-errors": "^2.0.0", @@ -1112,6 +1114,78 @@ "ws": "^8.0.0" } }, + "node_modules/@grpc/grpc-js": { + "version": "1.9.14", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.14.tgz", + "integrity": "sha512-nOpuzZ2G3IuMFN+UPPpKrC6NsLmWsTqSsm66IRfnBt1D4pwTqE27lmbpcPM+l2Ua4gE7PfjRHI6uedAy7hoXUw==", + "dependencies": { + "@grpc/proto-loader": "^0.7.8", + "@types/node": ">=12.12.47" + }, + "engines": { + "node": "^8.13.0 || >=10.10.0" + } + }, + "node_modules/@grpc/grpc-js/node_modules/@grpc/proto-loader": { + "version": "0.7.10", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.10.tgz", + "integrity": "sha512-CAqDfoaQ8ykFd9zqBDn4k6iWT9loLAlc2ETmDFS9JCD70gDcnA4L3AFEo2iV7KyAtAAHFW9ftq1Fz+Vsgq80RQ==", + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.2.4", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@grpc/grpc-js/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@grpc/grpc-js/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/@grpc/grpc-js/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@grpc/grpc-js/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, "node_modules/@grpc/proto-loader": { "version": "0.6.13", "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.13.tgz", @@ -4891,7 +4965,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, "engines": { "node": ">=6" } @@ -6825,6 +6898,11 @@ "node": ">= 4" } }, + "node_modules/google-protobuf": { + "version": "3.21.2", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz", + "integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA==" + }, "node_modules/graceful-fs": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", @@ -9129,8 +9207,7 @@ "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" }, "node_modules/lodash.merge": { "version": "4.6.2", @@ -13363,7 +13440,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -13451,7 +13527,6 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, "engines": { "node": ">=10" } diff --git a/package.json b/package.json index e65be7c3..e8174d46 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,9 @@ "xxhash-wasm": "^0.4.2", "yaml": "^1.10.2", "@stricjs/utils": "^1.6.1", - "basic-auth": "^2.0.1" + "basic-auth": "^2.0.1", + "google-protobuf": "^3.21.2", + "@grpc/grpc-js": "^1.9.14" }, "devDependencies": { "@elastic/elasticsearch": "^8.5.0", From af0d7ace36d1048d98296e034682377a21033824 Mon Sep 17 00:00:00 2001 From: akvlad Date: Wed, 24 Jan 2024 13:46:17 +0200 Subject: [PATCH 14/18] debug --- pyroscope/pyroscope.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js index 26c01d84..97836db8 100644 --- a/pyroscope/pyroscope.js +++ b/pyroscope/pyroscope.js @@ -122,10 +122,10 @@ const labelSelectorQuery = (query, labelSelector) => { valRul = Sql.Ne(new Sql.Raw('val'), Sql.val(val)) break case '=~': - valRul = Sql.Eq(`match(val, ${Sql.quoteVal(val)})`, 1) + valRul = Sql.Eq(new Sql.Raw(`match(val, ${Sql.quoteVal(val)})`), 1) break case '!~': - valRul = Sql.Ne(`match(val, ${Sql.quoteVal(val)})`, 1) + valRul = Sql.Ne(new Sql.Raw(`match(val, ${Sql.quoteVal(val)})`), 1) } const labelSubCond = Sql.And( Sql.Eq('key', Sql.val(rule.Child('label').value)), @@ -176,6 +176,7 @@ const selectMergeStacktraces = async (req, res) => { responseType: 'arraybuffer' }) const binData = Uint8Array.from(profiles.data) + req.log.debug(`profiles: ${binData.length / 1025} kB`) require('./pprof-bin/pkg/pprof_bin').init_panic_hook() const promises = [] const _ctxIdx = ++ctxIdx @@ -247,7 +248,7 @@ const selectSeries = async (req, res) => { let tagsReq = 'arraySort(p.tags)' if (groupBy) { - tagsReq = `arraySort(arrayFilter(x -> x in (${groupBy.map(g => Sql.quoteVal(g)).join(',')}), p.tags))` + tagsReq = `arraySort(arrayFilter(x -> x.1 in (${groupBy.map(g => Sql.quoteVal(g)).join(',')}), p.tags))` } const labelsReq = (new Sql.Select()).with(withIdxReq).select( From 8129c1add9a89eeec936a88c574246033ba76103 Mon Sep 17 00:00:00 2001 From: akvlad Date: Wed, 24 Jan 2024 13:51:37 +0200 Subject: [PATCH 15/18] support ADVANCED_PROFILES_MERGE_LIMIT limit --- pyroscope/pyroscope.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js index 97836db8..1849b17b 100644 --- a/pyroscope/pyroscope.js +++ b/pyroscope/pyroscope.js @@ -172,7 +172,10 @@ const selectMergeStacktraces = async (req, res) => { Sql.Lte('timestamp_ns', new Sql.Raw(Math.floor(toTimeSec) + '000000000')), new Sql.In('fingerprint', 'IN', idxSelect) )) - const profiles = await clickhouse.rawRequest(sqlReq.toString() + 'FORMAT RowBinary', null, DATABASE_NAME(), { + if (process.env.ADVANCED_PROFILES_MERGE_LIMIT) { + sqlReq.orderBy(['timestamp_ns', 'desc']).limit(parseInt(process.env.ADVANCED_PROFILES_MERGE_LIMIT)) + } + const profiles = await clickhouse.rawRequest(sqlReq.toString() + ' FORMAT RowBinary', null, DATABASE_NAME(), { responseType: 'arraybuffer' }) const binData = Uint8Array.from(profiles.data) From 0954584df8c95657ab27941868f6c4c0f7f35f6b Mon Sep 17 00:00:00 2001 From: akvlad Date: Wed, 24 Jan 2024 13:59:12 +0200 Subject: [PATCH 16/18] support ADVANCED_PROFILES_MERGE_LIMIT to limit selectMergeStacktraces --- pyroscope/pyroscope.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js index 1849b17b..75705f14 100644 --- a/pyroscope/pyroscope.js +++ b/pyroscope/pyroscope.js @@ -175,9 +175,12 @@ const selectMergeStacktraces = async (req, res) => { if (process.env.ADVANCED_PROFILES_MERGE_LIMIT) { sqlReq.orderBy(['timestamp_ns', 'desc']).limit(parseInt(process.env.ADVANCED_PROFILES_MERGE_LIMIT)) } - const profiles = await clickhouse.rawRequest(sqlReq.toString() + ' FORMAT RowBinary', null, DATABASE_NAME(), { - responseType: 'arraybuffer' - }) + const profiles = await clickhouse.rawRequest(sqlReq.toString() + ' FORMAT RowBinary', + null, + DATABASE_NAME(), + { + responseType: 'arraybuffer' + }) const binData = Uint8Array.from(profiles.data) req.log.debug(`profiles: ${binData.length / 1025} kB`) require('./pprof-bin/pkg/pprof_bin').init_panic_hook() From 47301778bcd0837b2a5191e66107fdf2ec76bf63 Mon Sep 17 00:00:00 2001 From: akvlad Date: Wed, 24 Jan 2024 16:00:48 +0200 Subject: [PATCH 17/18] support _dist table for clusters; fix init --- lib/db/maintain/index.js | 4 ++-- pyroscope/pyroscope.js | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/db/maintain/index.js b/lib/db/maintain/index.js index b4a844be..c2076e79 100644 --- a/lib/db/maintain/index.js +++ b/lib/db/maintain/index.js @@ -20,7 +20,7 @@ const getEnv = () => { module.exports.upgrade = async (db) => { await upgradeSingle(db.name, 1, scripts.overall, db.storage_policy) await upgradeSingle(db.name, 2, scripts.traces, db.storage_policy) - await upgradeSingle(db.name, 5, scripts.traces, db.storage_policy) + await upgradeSingle(db.name, 5, scripts.profiles, db.storage_policy) if (db.storage_policy) { await client.addSetting('rotate', 'v3_storage_policy', db.storage_policy, db.name) await client.addSetting('rotate', 'v1_traces_storage_policy', db.storage_policy, db.name) @@ -28,7 +28,7 @@ module.exports.upgrade = async (db) => { if (clusterName) { await upgradeSingle(db.name, 3, scripts.overall_dist, db.storage_policy) await upgradeSingle(db.name, 4, scripts.traces_dist, db.storage_policy) - await upgradeSingle(db.name, 6, scripts.traces_dist, db.storage_policy) + await upgradeSingle(db.name, 6, scripts.profiles_dist, db.storage_policy) } } diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js index 75705f14..6c25e2ba 100644 --- a/pyroscope/pyroscope.js +++ b/pyroscope/pyroscope.js @@ -8,10 +8,12 @@ const compiler = require('../parser/bnf') const { readULeb32 } = require('./pprof') const pprofBin = require('./pprof-bin/pkg/pprof_bin') const { QrynBadRequest } = require('../lib/handlers/errors') +const { clusterName} = require('../common') const HISTORY_TIMESPAN = 1000 * 60 * 60 * 24 * 7 const profileTypesHandler = async (req, res) => { + const dist = clusterName ? '_dist' : '' const _res = new messages.ProfileTypesResponse() const fromTimeSec = req.body && req.body.getStart ? parseInt(req.body.getStart()) / 1000 @@ -20,7 +22,7 @@ const profileTypesHandler = async (req, res) => { ? parseInt(req.body.getEnd()) / 1000 : Date.now() / 1000 const profileTypes = await clickhouse.rawRequest(`SELECT DISTINCT type_id, sample_type_unit -FROM profiles_series ARRAY JOIN sample_types_units as sample_type_unit +FROM profiles_series${dist} ARRAY JOIN sample_types_units as sample_type_unit WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, null, DATABASE_NAME()) _res.setProfileTypesList(profileTypes.data.data.map(profileType => { @@ -38,6 +40,7 @@ WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDa } const labelNames = async (req, res) => { + const dist = clusterName ? '_dist' : '' const fromTimeSec = req.body && req.body.getStart ? parseInt(req.body.getStart()) / 1000 : (Date.now() - HISTORY_TIMESPAN) / 1000 @@ -45,7 +48,7 @@ const labelNames = async (req, res) => { ? parseInt(req.body.getEnd()) / 1000 : Date.now() / 1000 const labelNames = await clickhouse.rawRequest(`SELECT DISTINCT key -FROM profiles_series_keys +FROM profiles_series_keys${dist} WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, null, DATABASE_NAME()) const resp = new types.LabelNamesResponse() @@ -54,6 +57,7 @@ WHERE date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDa } const labelValues = async (req, res) => { + const dist = clusterName ? '_dist' : '' const name = req.body && req.body.getName ? req.body.getName() : '' @@ -67,7 +71,7 @@ const labelValues = async (req, res) => { throw new Error('No name provided') } const labelValues = await clickhouse.rawRequest(`SELECT DISTINCT val -FROM profiles_series_gin +FROM profiles_series_gin${dist} WHERE key = ${Sql.quoteVal(name)} AND date >= toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)})) AND date <= toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)})) FORMAT JSON`, null, DATABASE_NAME()) @@ -143,6 +147,7 @@ const labelSelectorQuery = (query, labelSelector) => { } const selectMergeStacktraces = async (req, res) => { + const dist = clusterName ? '_dist' : '' const typeRe = req.body.getProfileTypeid().match(/^(.+):([^:]+):([^:]+)$/) const sel = req.body.getLabelSelector() const fromTimeSec = req.body && req.body.getStart() @@ -165,7 +170,7 @@ const selectMergeStacktraces = async (req, res) => { labelSelectorQuery(idxSelect, sel) const sqlReq = (new Sql.Select()) .select('payload') - .from('profiles') + .from(`profiles${dist}`) .where( Sql.And( Sql.Gte('timestamp_ns', new Sql.Raw(Math.floor(fromTimeSec) + '000000000')), @@ -225,6 +230,7 @@ const selectSeries = async (req, res) => { if (!typeId) { throw new QrynBadRequest('Invalid type provided') } + const dist = clusterName ? '_dist' : '' const sampleTypeId = typeId[2] + ':' + typeId[3] const labelSelector = _req.getLabelSelector && _req.getLabelSelector() let groupBy = _req.getGroupByList && _req.getGroupByList() @@ -284,7 +290,7 @@ const selectSeries = async (req, res) => { [new Sql.Raw('labels.new_fingerprint'), 'fingerprint'], [new Sql.Raw('min(labels.tags)'), 'labels'], [valueCol, 'value'] - ).from(['profiles', 'p']).join( + ).from([`profiles${dist}`, 'p']).join( new Sql.WithReference(withLabelsReq), 'ANY LEFT', Sql.Eq(new Sql.Raw('p.fingerprint'), new Sql.Raw('labels.fingerprint')) From 037eff5217ac5730f4d98d03aa230ad4f2b66f0f Mon Sep 17 00:00:00 2001 From: akvlad Date: Wed, 24 Jan 2024 16:13:20 +0200 Subject: [PATCH 18/18] debug: distributed tables reading; maintain scripts --- lib/db/maintain/scripts.js | 35 ++++++++++++++++++++++++++--------- pyroscope/pyroscope.js | 16 ++++++++-------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/lib/db/maintain/scripts.js b/lib/db/maintain/scripts.js index 4098e7e6..823fb468 100644 --- a/lib/db/maintain/scripts.js +++ b/lib/db/maintain/scripts.js @@ -236,22 +236,26 @@ module.exports.profiles = [ timestamp_ns UInt64, type LowCardinality(String), service_name LowCardinality(String), + sample_types_units Array(Tuple(String, String)), period_type LowCardinality(String), period_unit LowCardinality(String), tags Array(Tuple(String, String)), duration_ns UInt64, payload_type LowCardinality(String), - payload String + payload String, + values_agg Array(Tuple(String, Int64, Int32)) CODEC(ZSTD(1)) ) Engine=Null`, `CREATE TABLE IF NOT EXISTS profiles {{{OnCluster}}} ( timestamp_ns UInt64 CODEC(DoubleDelta, ZSTD(1)), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), type_id LowCardinality(String) CODEC(ZSTD(1)), + sample_types_units Array(Tuple(String, String)) CODEC(ZSTD(1)), service_name LowCardinality(String) CODEC(ZSTD(1)), duration_ns UInt64 CODEC(DoubleDelta, ZSTD(1)), payload_type LowCardinality(String) CODEC(ZSTD(1)), - payload String CODEC(ZSTD(1)) + payload String CODEC(ZSTD(1)), + values_agg Array(Tuple(String, Int64, Int32)) CODEC(ZSTD(1)) ) Engine {{MergeTree}}() ORDER BY (type_id, service_name, timestamp_ns) PARTITION BY toDate(FROM_UNIXTIME(intDiv(timestamp_ns, 1000000000)))`, @@ -260,18 +264,24 @@ module.exports.profiles = [ SELECT timestamp_ns, cityHash64(arraySort(arrayConcat( - profiles_input.tags, [('__type__', concatWithSeparator(':', type, period_type, period_unit) as _type_id), ('service_name', service_name)] - )) as _tags) as fingerprint, + profiles_input.tags, [ + ('__type__', concatWithSeparator(':', type, period_type, period_unit) as _type_id), + ('__sample_types_units__', arrayStringConcat(arrayMap(x -> x.1 || ':' || x.2, arraySort(sample_types_units)), ';')), + ('service_name', service_name) + ])) as _tags) as fingerprint, _type_id as type_id, + sample_types_units, service_name, duration_ns, payload_type, - payload + payload, + values_agg FROM profiles_input`, `CREATE TABLE IF NOT EXISTS profiles_series {{{OnCluster}}} ( date Date CODEC(ZSTD(1)), type_id LowCardinality(String) CODEC(ZSTD(1)), + sample_types_units Array(Tuple(String, String)) CODEC(ZSTD(1)), service_name LowCardinality(String) CODEC(ZSTD(1)), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), tags Array(Tuple(String, String)) CODEC(ZSTD(1)), @@ -283,11 +293,15 @@ module.exports.profiles = [ SELECT toDate(intDiv(timestamp_ns, 1000000000)) as date, concatWithSeparator(':', type, period_type, period_unit) as type_id, + sample_types_units, service_name, cityHash64(arraySort(arrayConcat( - profiles_input.tags, [('__type__', type_id), ('service_name', service_name)] - )) as _tags) as fingerprint, - tags + profiles_input.tags, [ + ('__type__', type_id), + ('__sample_types_units__', arrayStringConcat(arrayMap(x -> x.1 || ':' || x.2, arraySort(sample_types_units)), ';')), + ('service_name', service_name) + ])) as _tags) as fingerprint, + arrayConcat(profiles_input.tags, [('service_name', service_name)]) as tags FROM profiles_input`, `CREATE TABLE IF NOT EXISTS profiles_series_gin {{{OnCluster}}} ( @@ -295,6 +309,7 @@ module.exports.profiles = [ key String CODEC(ZSTD(1)), val String CODEC(ZSTD(1)), type_id LowCardinality(String) CODEC(ZSTD(1)), + sample_types_units Array(Tuple(String, String)), service_name LowCardinality(String) CODEC(ZSTD(1)), fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)), ) Engine {{ReplacingMergeTree}}() @@ -307,6 +322,7 @@ module.exports.profiles = [ kv.1 as key, kv.2 as val, type_id, + sample_types_units, service_name, fingerprint, FROM profiles_series ARRAY JOIN tags as kv`, @@ -337,7 +353,8 @@ module.exports.profiles_dist = [ service_name LowCardinality(String), duration_ns UInt64, payload_type LowCardinality(String), - payload String + payload String, + values_agg Array(Tuple(String, Int64, Int32)) ) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles', fingerprint);`, `CREATE TABLE IF NOT EXISTS profiles_series_dist {{{OnCluster}}} ( diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js index 6c25e2ba..d6492a0c 100644 --- a/pyroscope/pyroscope.js +++ b/pyroscope/pyroscope.js @@ -158,7 +158,7 @@ const selectMergeStacktraces = async (req, res) => { : Math.floor(Date.now() / 1000) const idxSelect = (new Sql.Select()) .select('fingerprint') - .from('profiles_series_gin') + .from(`${DATABASE_NAME()}.profiles_series_gin`) .where( Sql.And( Sql.Eq(new Sql.Raw(`has(sample_types_units, (${Sql.quoteVal(typeRe[2])},${Sql.quoteVal(typeRe[3])}))`), 1), @@ -170,7 +170,7 @@ const selectMergeStacktraces = async (req, res) => { labelSelectorQuery(idxSelect, sel) const sqlReq = (new Sql.Select()) .select('payload') - .from(`profiles${dist}`) + .from(`${DATABASE_NAME()}.profiles${dist}`) .where( Sql.And( Sql.Gte('timestamp_ns', new Sql.Raw(Math.floor(fromTimeSec) + '000000000')), @@ -243,7 +243,7 @@ const selectSeries = async (req, res) => { const idxReq = (new Sql.Select()) .select(new Sql.Raw('fingerprint')) - .from('profiles_series_gin') + .from(`${DATABASE_NAME()}.profiles_series_gin`) .where( Sql.And( Sql.Eq('type_id', Sql.val(typeId[1])), @@ -256,7 +256,7 @@ const selectSeries = async (req, res) => { ) labelSelectorQuery(idxReq, labelSelector) - const withIdxReq = (new Sql.With('idx', idxReq, false)) + const withIdxReq = (new Sql.With('idx', idxReq, !!clusterName)) let tagsReq = 'arraySort(p.tags)' if (groupBy) { @@ -267,14 +267,14 @@ const selectSeries = async (req, res) => { 'fingerprint', [new Sql.Raw(tagsReq), 'tags'], [groupBy ? 'fingerprint' : new Sql.Raw('cityHash64(tags)'), 'new_fingerprint'] - ).distinct(true).from(['profiles_series', 'p']) + ).distinct(true).from([`${DATABASE_NAME()}.profiles_series`, 'p']) .where(Sql.And( new Sql.In('fingerprint', 'IN', new Sql.WithReference(withIdxReq)), Sql.Gte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(fromTimeSec)}))`)), Sql.Lte('date', new Sql.Raw(`toDate(FROM_UNIXTIME(${Math.floor(toTimeSec)}))`)) )) - const withLabelsReq = new Sql.With('labels', labelsReq, false) + const withLabelsReq = new Sql.With('labels', labelsReq, !!clusterName) let valueCol = new Sql.Raw( `sum(toFloat64(arrayFirst(x -> x.1 == ${Sql.quoteVal(sampleTypeId)}, p.values_agg).2))`) @@ -290,8 +290,8 @@ const selectSeries = async (req, res) => { [new Sql.Raw('labels.new_fingerprint'), 'fingerprint'], [new Sql.Raw('min(labels.tags)'), 'labels'], [valueCol, 'value'] - ).from([`profiles${dist}`, 'p']).join( - new Sql.WithReference(withLabelsReq), + ).from([`${DATABASE_NAME()}.profiles${dist}`, 'p']).join( + [new Sql.WithReference(withLabelsReq), 'labels'], 'ANY LEFT', Sql.Eq(new Sql.Raw('p.fingerprint'), new Sql.Raw('labels.fingerprint')) ).where(