Skip to content

Commit

Permalink
Prepare for upcoming changes from CLP-s
Browse files Browse the repository at this point in the history
  • Loading branch information
haiqi96 committed Nov 19, 2024
1 parent ae6a601 commit ce1acdb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ def start_log_viewer_webui(
"MongoDbStreamFilesCollectionName": clp_config.results_cache.stream_collection_name,
"ClientDir": str(container_log_viewer_webui_dir / "client"),
"StreamFilesDir": str(container_clp_config.stream_output.directory),
"StreamTargetUncompressedSize": container_clp_config.stream_output.target_uncompressed_size,
"LogViewerDir": str(container_log_viewer_webui_dir / "yscope-log-viewer"),
}
settings_json = read_and_update_settings_json(settings_json_path, settings_json_updates)
Expand Down
1 change: 1 addition & 0 deletions components/log-viewer-webui/server/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@

"ClientDir": "../client/dist",
"StreamFilesDir": "../../../build/clp-package/var/data/streams",
"StreamTargetUncompressedSize": 134217728,
"LogViewerDir": "../yscope-log-viewer/dist"
}
12 changes: 4 additions & 8 deletions components/log-viewer-webui/server/src/routes/query.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import settings from "../../settings.json" with {type: "json"};
import {QUERY_JOB_TYPE} from "../DbManager.js";


// eslint-disable-next-line no-magic-numbers
const EXTRACT_IR_TARGET_UNCOMPRESSED_SIZE = 128 * 1024 * 1024;
// eslint-disable-next-line no-magic-numbers
const EXTRACT_JSON_TARGET_CHUNK_SIZE = 100 * 1000;


/**
* Submits a stream extraction job with the given parameters and waits for it.
*
Expand All @@ -23,17 +18,18 @@ const submitAndWaitForExtractStreamJob = async (
sanitizedLogEventIdx
) => {
let jobConfig;
const streamTargetUncompressedSize = settings.StreamTargetUncompressedSize;
if (QUERY_JOB_TYPE.EXTRACT_IR === extractJobType) {
jobConfig = {
file_split_id: null,
msg_ix: sanitizedLogEventIdx,
orig_file_id: streamId,
target_uncompressed_size: EXTRACT_IR_TARGET_UNCOMPRESSED_SIZE,
target_uncompressed_size: streamTargetUncompressedSize,
};
} else if (QUERY_JOB_TYPE.EXTRACT_JSON === extractJobType) {
jobConfig = {
archive_id: streamId,
target_chunk_size: EXTRACT_JSON_TARGET_CHUNK_SIZE,
target_chunk_size: streamTargetUncompressedSize,
};
}

Expand Down
2 changes: 1 addition & 1 deletion components/package-template/src/etc/clp-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
#stream_output:
# directory: "var/data/streams"
#
# # How large each IR file should be before being split into a new IR file
# # How large each stream file should be before being split into a new stream file
# target_uncompressed_size: 134217728 # 128 MB
#
## Location where other data (besides archives) are stored. It will be created if
Expand Down

0 comments on commit ce1acdb

Please sign in to comment.