MCPcopy Create free account
hub / github.com/Marus/cortex-debug / getData

Method getData

src/grapher/datasource.ts:47–58  ·  view source on GitHub ↗
(graphId: string, start: number, end: number, pad: boolean = true)

Source from the content-addressed store, hash-verified

45 }
46
47 public getData(graphId: string, start: number, end: number, pad: boolean = true): GraphPoint[] {
48 let data: GraphPoint[] = this.data[graphId];
49 if (!data) { return []; }
50
51 data = data.filter((gp) => gp.timestamp >= start && gp.timestamp <= end);
52 if (pad && data.length >= 1) {
53 const ep = data[data.length - 1];
54 data.push({ timestamp: end, value: ep.value });
55 }
56
57 return data;
58 }
59
60 public sampleData(graphId: string, sampleSize: number, start: number = null, end: number = null): GraphPoint[] {
61 let data: GraphPoint[] = this.data[graphId];

Callers 1

updateGraphMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected