Add new PubSub cfg to DSQA
At least the server address (port) needs to be exposed
This commit is contained in:
1 parent
9fc3c2618e
commit
ca73220a2e
3 files changed
+74
-3
No files matched your search
+59
-1
@@ -1,3 +1,61 @@
|
||||
{
|
||||
"user": "bts"
|
||||
"user": "bts",
|
||||
"pubsub": {
|
||||
"milliseconds_between_sub_info_updates": 1000,
|
||||
"milliseconds_between_time_slice_updates": 5000,
|
||||
"milliseconds_between_no_buffer_space_retries": 100,
|
||||
"retries_on_no_buffer_space": 1,
|
||||
"do_it_all_seconds_between_logs": 0,
|
||||
"heartbeat_interval": 15000,
|
||||
"missing_heartbeats_before_gc": 50,
|
||||
"use_managed_sockets": true,
|
||||
"state_update_period": 5000,
|
||||
"statistics_update_period": 5000,
|
||||
"disposed_connection_check_period": 1000,
|
||||
"message_processing_warning_threshold": 1000,
|
||||
"server_port": 12345,
|
||||
"publisher_routes": [
|
||||
{
|
||||
"name": "default",
|
||||
"server_address": "bluto://localhost:12345",
|
||||
"tag": ".*"
|
||||
}
|
||||
],
|
||||
"subscriber_routes": [
|
||||
{
|
||||
"name": "default",
|
||||
"server_address": "bluto://localhost:12345",
|
||||
"tag": ".*"
|
||||
}
|
||||
],
|
||||
"max_packet_size": 500000000,
|
||||
"blue_comm_must_die": true,
|
||||
"crushable_tags": [],
|
||||
"tag_type_to_assembly_map": [
|
||||
{
|
||||
"handler_class": "BCG.PubSubServerTagHandler",
|
||||
"assembly": "DataStreamCore.dll"
|
||||
}
|
||||
],
|
||||
"server_queue": "PubSubQueue",
|
||||
"port_range": {
|
||||
"first": 30400,
|
||||
"last": 31700
|
||||
},
|
||||
"bind_to_random_port": false,
|
||||
"debug_tags": "^NOTAGS$",
|
||||
"latency_report_threshold_ms": 1500,
|
||||
"use_substations": false,
|
||||
"use_dynamic_clients": false,
|
||||
"is_substation": false,
|
||||
"internally_publish_sub_info": true,
|
||||
"use_managed_clients_in_native_code": false,
|
||||
"compressed_tags": "^NOTAGS$",
|
||||
"tags_to_report_compression_ratio": "^NOTAGS$",
|
||||
"disable_msmq": false,
|
||||
"use_prepublished_server_state": false,
|
||||
"ip_translation": null,
|
||||
"gc_activation_threshold": 0,
|
||||
"wait_period_after_gc": 1000
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
namespace Bts.DataStreamQueryAnalyzer;
|
||||
|
||||
using Bts.PubSub;
|
||||
|
||||
using CommandLine;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
@@ -34,6 +35,9 @@ public class DataStreamQueryAnalyzerConfig {
|
||||
[Option("stream-file", HelpText = "Stream file to load")]
|
||||
public string? StreamFile { get; set; }
|
||||
|
||||
[JsonPropertyName("pubsub")]
|
||||
public PubSubConfig? PubSub { get; set; }
|
||||
|
||||
[Option(
|
||||
"config",
|
||||
MetaValue = "PATH",
|
||||
@@ -41,9 +45,17 @@ public class DataStreamQueryAnalyzerConfig {
|
||||
[JsonIgnore]
|
||||
public string? ConfigFile { get; set; }
|
||||
|
||||
public static DataStreamQueryAnalyzerConfig Default() =>
|
||||
new() {
|
||||
User = "bts",
|
||||
Sparkd = "http://localhost:8000/config",
|
||||
PubSub = PubSubConfig.Default(),
|
||||
};
|
||||
|
||||
public void MergeWith(DataStreamQueryAnalyzerConfig other) {
|
||||
User ??= other.User;
|
||||
Password ??= other.Password;
|
||||
PubSub ??= other.PubSub;
|
||||
Sparkd ??= other.Sparkd;
|
||||
StreamFile ??= other.StreamFile;
|
||||
ConfigFile ??= other.ConfigFile;
|
||||
|
||||
@@ -23,7 +23,8 @@ static class Program {
|
||||
async Task<int> RunAsync(DataStreamQueryAnalyzerConfig cfg) {
|
||||
try {
|
||||
cfg.MergeWithConfigFile();
|
||||
PubSubConfig.SetGlobalConfig(PubSubConfig.Default());
|
||||
cfg.MergeWith(DataStreamQueryAnalyzerConfig.Default());
|
||||
PubSubConfig.SetGlobalConfig(Log.notnull(cfg.PubSub));
|
||||
Configuration.initialize(cfg.Sparkd);
|
||||
Log.Gen.info("Starting DataStreamQueryAnalyzer");
|
||||
var service_ctx = ServiceContext.create(cfg.Sparkd);
|
||||
|
||||
Reference in new issue
Block a user