Created
September 3, 2023 09:57
-
-
Save tauoverpi/2467b6ee3330c1a3f5f51ec82c775d21 to your computer and use it in GitHub Desktop.
Diagrams used when explaining stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stack over time | |
// ,-------------, | |
var outputTable = Table.init(4, allocator); // ,-> | outputTable | | |
// | |-------------|---, | |
for (alerts.value.data.alerts) |a| { // | | outputTable | a | stack location of `r` | |
// | |-------------|---|---, | |
var r = [_][]u8{ // | | outputTable | a | r | stack location of the fields of `a` when placed in the array of slices passed to `r` -------, | |
// | |-------------|---|---|-------------------, | | |
a.labels.instance, // f | | outputTable | a | r | a.labels.instance | | | |
// l | |-------------|---|---|-------------------|---------, | | |
a.state, // o | | outputTable | a | r | a.labels.instance | a.state | | | |
// w | |-------------|---|---|-------------------|---------|--------------------, | | |
a.labels.alertname, // | | outputTable | a | r | a.labels.instance | a.state | a.labels.alertname | | | |
// | |-------------|---|---|-------------------|---------|--------------------|---------------------------, | | |
a.annotations.description, // | | outputTable | a | r | a.labels.instance | a.state | a.labels.alertname | a.annotations.description | | | |
}; // | |-------------|---|---|-------------------|---------|--------------------|---------------------------|--------------, | |
try outputTable.addRow(&r); // | | outputTable | a | r | a.labels.instance | a.state | a.labels.alertname | a.annotations.description | addRow frame | | |
// | |-------------|---'---'-------------------'---------'--------------------'---------------------------'--------------' | |
} // '-- | outputTable | everything within is dropped at the end of scope <--------------------------------------------------' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment