Commit Graph

46 Commits

Author SHA1 Message Date
Fabian Bees
708889d558 feat/console: option to sort by last column 2025-02-21 10:03:30 +01:00
Vincent Bernat
2df8b5785b console: use avg/max for LimitType (instead of Avg/Max) 2024-11-23 23:48:02 +01:00
dimbdr
6c0e8e1791 feat: configure limit type (#1482)
* Add limit type field selection

* Take into account LimitType to generate SQL request for Line graph

Also, add LimitType in default configuration for console

* Take into account LimitType to generate SQL request for Sankey graph

* Refactor on SQL query used by line and sankey

* Add limitType description in doc

* Order by max in graphLine when limitType max is used

* Fix query when using top max

Revert some modifications, as they were no longer relevant with the query fixed.

* Rework way to sort by max in line graph type

* Add configuration validation on LimitType

---------

Co-authored-by: Dimitri Baudrier <github.52grm@simplelogin.com>
2024-11-23 18:39:28 +01:00
Vincent Bernat
88b27a83e6 console: fix use of aliased columns in dimensions
By default, `SELECT *` does not select ALIAS columns. Add the
appropriate settings to modify this.

Fix #541
2023-03-03 08:27:39 +01:00
Vincent Bernat
7bc80ac541 console: fix subnet aggregation when IPv6 or IPv4 is set to default
Fix #534
2023-02-28 09:44:59 +01:00
Vincent Bernat
63267f0f5b console: enable SrcAddr/DstAddr truncation to a fixed length 2023-02-22 20:55:21 +01:00
Vincent Bernat
609fa24a27 console: factor graphXXXHandlerInput
This is similar to what is done in TypeScript.
2023-02-22 20:54:58 +01:00
Vincent Bernat
e4c3a6b723 console: move /sankey and /graph to /graph/sankey and /graph/line
Also rename stuff to GraphSankey and GraphLine for consistency.
2023-02-22 20:54:58 +01:00
Vincent Bernat
9bc7f44f0a console/graph: also invert unit direction on bidirectional 2023-02-09 23:27:03 +01:00
Vincent Bernat
d5cde97891 console: add “%” to available units
This is useful to detect interfaces that are close to saturation
quickly. It would usually require to group by exporter name and
interface name and it may not make sense for some graph types (like
stacked 100%). It is useful with Lines and Grid.
2023-02-09 21:14:36 +01:00
Vincent Bernat
c6a9319b57 common/schema: turns into a component
This is a first step to make it accept configuration. Most of the
changes are quite trivial, but I also ran into some difficulties with
query columns and filters. They need the schema for parsing, but parsing
happens before dependencies are instantiated (and even if it was not the
case, parsing is stateless). Therefore, I have added a `Validate()`
method that must be called after instantiation. Various bits `panic()`
if not validated to ensure we catch all cases.

The alternative to make the component manages a global state would have
been simpler but it would break once we add the ability to add or
disable columns.
2023-01-18 12:22:10 +01:00
Vincent Bernat
727807b937 common/schema: use a symbol to identify columns 2023-01-17 20:53:00 +01:00
Vincent Bernat
9c7e3db6e7 console: make the upper limit for dimensions configurable 2022-10-05 08:25:25 +02:00
Vincent Bernat
672d632a5a console: use INTERPOLATE to fill values when no value present
This dump the requirement on ClickHouse to 22.4. Use 22.8 LTS. This
should also fix a memory leak (not yet fixed in 22.3).
2022-09-08 15:43:27 +02:00
Vincent Bernat
78fb01c223 chore: fix some small issues detected by golangci-lint
But not using it as some linters are either plain incorrect (the one
suggesting to not use nil for `c.t.Context()`) or just
debatable (checking for err value is a good practice, but there are
good reasons to opt out in some cases).
2022-08-10 17:44:32 +02:00
Vincent Bernat
454a3eb9d3 console: add "previous period" mode
This displays a line for the previous period on stacked graphs.
Previous period depends on the current period. It could be hour, day,
week, month, or year.
2022-08-09 21:40:06 +02:00
Vincent Bernat
8e755ae0e1 console: ensure we fill missing values including the last one
BETWEEN is inclusive, while FILL excludes the upper bound. This may
trigger a subtle bug where sometimes, one axis has one value the other
does not have.
2022-08-09 19:16:16 +02:00
Vincent Bernat
67703cc61e console: use templates to build SQL query
This is needed if we want to be able to mix use of several tables
inside a single query (for example, flows_1m0s for a part of the query
and flows_5m0s for another part to overlay historical data).

Also, the way we handle time buckets is now cleaner. The previous way
had two stages of rounding and was incorrect. We were discarding the
first and last value for this reason. The new way only has one stage
of rounding and is correct. It tries hard to align the buckets at the
specified start time. We don't need to discard these values anymore.
We still discard the last one because it could be incomplete (when end
is "now").
2022-08-09 11:45:40 +02:00
Vincent Bernat
b5e48e8cfd console: also use dimensions to tell if we need to use main table 2022-08-08 11:35:18 +02:00
Vincent Bernat
b745cfd356 console: fix test about reverse filter direction 2022-08-08 09:42:27 +02:00
Vincent Bernat
50614cef5b console: add a bidirectional mode for graphs
It allows one to also display flows in the opposite direction.
2022-08-07 23:15:18 +02:00
Vincent Bernat
1aa260bae2 console/filter: let parser tells us if we need the main table or not
This is more robust this way. We also introduce the ability to reverse
the direction of a filter.
2022-08-04 18:54:41 +02:00
Vincent Bernat
fad0c5db16 console: simplify SQL request by computing target resolution in Go 2022-07-26 23:51:32 +02:00
Vincent Bernat
f5e2e85d0d console: fix a possible divide by 0 error
This is not the only problem we have.
2022-07-09 08:42:42 +02:00
Vincent Bernat
418bf5176e console: exclude 0 from minimum value 2022-07-08 15:36:12 +02:00
Vincent Bernat
412bb1f535 console: fill missing values with 0 for timeseries graphs 2022-07-08 09:43:09 +02:00
Vincent Bernat
8be1bca4fd license: AGPL-3.0-only
```
git ls-files \*.js \*.go \
  | xargs sed -i '1i // SPDX-FileCopyrightText: 2022 Free Mobile\n// SPDX-License-Identifier: AGPL-3.0-only\n'
git ls-files \*.vue \
  | xargs sed -i '1i <!-- SPDX-FileCopyrightText: 2022 Free Mobile -->\n<!-- SPDX-License-Identifier: AGPL-3.0-only -->\n'
```
2022-06-29 11:42:28 +02:00
Vincent Bernat
a1ff21eb09 console: ability to display L2 bps in addition to L3 bps 2022-06-03 11:47:38 +02:00
Vincent Bernat
2d4f5214bd tests: handle JSON in TestHTTPEndpoints 2022-05-26 10:40:55 +02:00
Vincent Bernat
6b6e1b8fba doc: update with a few words about the console 2022-05-24 22:09:21 +02:00
Vincent Bernat
be444652f0 console: ability to get values in pps instead of bps 2022-05-24 20:34:23 +02:00
Vincent Bernat
eb75dc40ac console: add 95th percentile 2022-05-24 19:46:41 +02:00
Vincent Bernat
bd3c79c057 console: endpoint for sankey graph 2022-05-22 16:48:36 +02:00
Vincent Bernat
fb7c51653f console: rely on validator to check input values 2022-05-21 22:47:19 +02:00
Vincent Bernat
375a0fe88f console: split graph.go into query.go and graph.go
We will introduce more query types.
2022-05-21 19:53:08 +02:00
Vincent Bernat
c23e5c1687 console/frontend: use static generated content for fields
This is more reliable and efficient but it also remove a bug with
equality comparison failing and thus inability to remove entries.
Also, sorted exactly as we want.
2022-05-18 08:49:03 +02:00
Vincent Bernat
dd64d02b48 console/frontend: better error formatting 2022-05-16 21:45:03 +02:00
Vincent Bernat
44ab2c380c console: use a parser to parse filter
An AST is not that useful for us. We just need to validate and
transform to proper SQL a filter string. Since it is SQL-like, this is
not hard to do.
2022-05-16 18:29:46 +02:00
Vincent Bernat
34f153d9cd console: dynamically fetch available dimensions 2022-05-16 10:19:53 +02:00
Vincent Bernat
eefd7088b9 console: remove /fields endpoint as we don't use it 2022-05-15 15:24:50 +02:00
Vincent Bernat
04d818e00f console/frontend: add a selector for dimensions 2022-05-15 15:19:55 +02:00
Vincent Bernat
0258e2bedb console: rename column to field 2022-05-13 10:44:51 +02:00
Vincent Bernat
eeb6da5730 console: rename max-series to limit 2022-05-12 14:27:18 +02:00
Vincent Bernat
31aca4c73b console: ensure "Other" is last when returning data 2022-05-12 14:27:18 +02:00
Vincent Bernat
d2cc5f1953 console: ensure we don't return more than max-series
We weren't matching only the top series, but any combination of
columns matching the top series. Fix that.
2022-05-12 14:27:18 +02:00
Vincent Bernat
2319262340 console: add visualize tab
Currently, there is no controls available.
2022-05-12 14:27:18 +02:00