1
0
mirror of https://github.com/metrico/qryn.git synced 2025-03-15 19:18:09 +00:00

fix rust library bug

This commit is contained in:
akvlad
2024-08-21 20:43:04 +03:00
parent d667b5b808
commit 3611964b17
5 changed files with 5 additions and 5 deletions

Binary file not shown.

@ -23,6 +23,8 @@ use std::vec::Vec;
use wasm_bindgen::prelude::*;
use std::sync::Arc;
//TODO: REMOVE
use std::fs;
pub mod pprof_pb {
@ -80,6 +82,9 @@ struct Tree {
impl Tree {
pub fn total(&self) -> i64 {
let mut total: i64 = 0;
if !self.nodes.contains_key(&0) {
return 0 as i64;
}
for c in 0..self.nodes.get(&0).unwrap().len() {
let _c = &self.nodes.get(&0).unwrap()[c];
total += _c.total[0];

@ -136,7 +136,6 @@ const bfs = (t) => {
* @param {string} sampleType
*/
const createFlameGraph = (pprofBinaries, sampleType) => {
console.log(`got ${pprofBinaries.length} profiles`)
const tree = new Tree()
tree.sampleType = sampleType
let start = Date.now()
@ -144,10 +143,8 @@ const createFlameGraph = (pprofBinaries, sampleType) => {
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) }
}

@ -402,7 +402,6 @@ const analyzeQuery = async (req, res) => {
const toTimeSec = Math.floor(req.getEnd && req.getEnd()
? parseInt(req.getEnd()) / 1000
: Date.now() / 1000)
console.log(query)
const scope = new messages.QueryScope()
scope.setComponentType('store')

@ -133,7 +133,6 @@ const selectSeriesImpl = async (fromTimeSec, toTimeSec, payload) => {
const resp = new messages.SelectSeriesResponse()
resp.setSeriesList(seriesList)
console.log(`Queried ${seriesList.length} series`)
return resp
}