-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve brimcap error handling (#2955)
- Loading branch information
Showing
15 changed files
with
209 additions
and
164 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import {compact} from "lodash" | ||
import {configurations} from "src/zui" | ||
import {pluginNamespace, yamlConfigPropName} from "./config" | ||
import {AnalyzeOptions, createCli} from "./cli" | ||
|
||
function getAnalyzeOptions(): AnalyzeOptions { | ||
return { | ||
json: true, | ||
config: configurations.get(pluginNamespace, yamlConfigPropName) || "", | ||
} | ||
} | ||
|
||
export function createAnalyzeProcess(signal) { | ||
const cli = createCli() | ||
const sub = cli.analyze("-", getAnalyzeOptions(), signal) | ||
return sub | ||
} | ||
|
||
export function monitorAnalyzeProgress(analyzeProc, callback) { | ||
analyzeProc.stderr | ||
.once("data", () => analyzeProc.stdout.emit("start")) | ||
.on("data", (data) => { | ||
const lines = compact(data.toString().split("\n")) as string[] | ||
const stats = lines.map((line) => JSON.parse(line)) | ||
stats.forEach(callback) | ||
}) | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {zeekColorMap} from "./zeek/colors" | ||
import {pools} from "src/zui" | ||
|
||
export function configureZeekPool(poolId: string) { | ||
pools | ||
.configure(poolId) | ||
.set("timeField", "ts") | ||
.set("colorField", "_path") | ||
.set("colorMap", zeekColorMap) | ||
} |
Oops, something went wrong.