Skip to content

Commit

Permalink
Add docs for xtdb analyze bits. (#3688)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanie0x00 authored Oct 16, 2024
1 parent c53f98d commit 3ab9a41
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/source/developer_documentation/octopoes.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,38 @@ $ ./xtdb-cli.py -n MyOrganisationName attribute-stats |jq .
 }
```

### XTDB analyze bits tool

This guide assumes the following:

- A virtual environment for the octopoes folder is created and the development requirements are installed.

This tooling can be used when you are developing bits (business rules). It outputs the transaction times in the database, the source and bit information, including parameters and how long the running time was.

Enable the `GATHER_BIT_METRICS` setting in the following file. The flag is at the bottom of the file. Change `GATHER_BIT_METRICS=False` to `GATHER_BIT_METRICS=True`.

```
octopoes/octopoes/config/settings.py
```

Run a `make reset` in your KAT instance to enable the setting:

```
make reset
```

Create some data by adding a hostname, enable some boefjes, etc. This will allow the bit metrics to be gathered. You can query the bit metrics using the following commands. The `node` is the name of your organisation. In this example the organisation name is 'aa'.

```
python3 octopoes/tools/analyze-bit-metric.py --node "aa" raw |jq
```

```
python3 octopoes/tools/xtdb-cli.py -n "aa" history --with-docs "BIT_METRIC" |jq
```

If you want to query the XTDB database directly, you can use the XTDB-tool. This is explained on the following page: https://docs.openkat.nl/developer_documentation/octopoes.html#xtdb-cli-tool.

## OOI

OOI objects are instances of relatively simple classes, which inherit from `OOI`.
Expand Down

0 comments on commit 3ab9a41

Please sign in to comment.