-
Notifications
You must be signed in to change notification settings - Fork 4
5. Client Examples
client_lib_multi_storytellers
is a test case that simulates a multi-threaded client writing logs to ChronoLog.
In addition to that, the client_admin
tool can be used to interact with a ChronoLog deployment.
You can run client_admin
in the interactive mode by passing -i
in the command line argument. Here is a simple example of how to use it in the interactive mode.
Config file specified: ../conf/visor_conf.json
Interactive mode: on
[ConfigurationManager] Loading configuration from file: ../conf/visor_conf.json
******** Start of configuration output ********
CLOCK_CONF: CLOCKSOURCE_TYPE: CPP_STYLE, DRIFT_CAL_SLEEP_SEC: 10, DRIFT_CAL_SLEEP_NSEC: 0
AUTH_CONF: AUTH_TYPE: RBAC, MODULE_PATH: /path/to/auth_module
VISOR_CONF: [VISOR_CLIENT_PORTAL_SERVICE_CONF: [RPC_CONF: [RPC_IMPLEMENTATION: CHRONOLOG_THALLIUM_SOCKETS, PROTO_CONF: ofi+sockets, IP: 127.0.0.1, BASE_PORT: 5555, SERVICE_PROVIDER_ID: 55, PORTS: ]], VISOR_KEEPER_REGISTRY_SERVICE_CONF: [RPC_CONF: [RPC_IMPLEMENTATION: CHRONOLOG_THALLIUM_SOCKETS, PROTO_CONF: ofi+sockets, IP: 127.0.0.1, BASE_PORT: 8888, SERVICE_PROVIDER_ID: 88, PORTS: ]], VISOR_LOG: [TYPE: file, FILE: /home/user/chronolog/bin/chrono_visor.log, LEVEL: DEBUG, NAME: ChronoVisor, LOGFILESIZE: 104857600, LOGFILENUM: 3, FLUSH LEVEL: WARN], DELAYED_DATA_ADMIN_EXIT_IN_SECS: 3]
KEEPER_CONF: [CHRONO_KEEPER_CONFIGURATION : RECORDING_GROUP: 7, KEEPER_RECORDING_SERVICE_CONF: [RPC_CONF: [RPC_IMPLEMENTATION: CHRONOLOG_THALLIUM_SOCKETS, PROTO_CONF: ofi+sockets, IP: 127.0.0.1, BASE_PORT: 6666, SERVICE_PROVIDER_ID: 66, PORTS: ]], KEEPER_DATA_STORE_ADMIN_SERVICE_CONF: [RPC_CONF: [RPC_IMPLEMENTATION: CHRONOLOG_THALLIUM_SOCKETS, PROTO_CONF: ofi+sockets, IP: 127.0.0.1, BASE_PORT: 7777, SERVICE_PROVIDER_ID: 77, PORTS: ]], VISOR_KEEPER_REGISTRY_SERVICE_CONF: [RPC_CONF: [RPC_IMPLEMENTATION: CHRONOLOG_THALLIUM_SOCKETS, PROTO_CONF: ofi+sockets, IP: 127.0.0.1, BASE_PORT: 8888, SERVICE_PROVIDER_ID: 88, PORTS: ]], STORY_FILES_DIR:/tmp/, KEEPER_LOG_CONF:[TYPE: file, FILE: chrono_keeper.log, LEVEL: DEBUG, NAME: ChronoKeeper, LOGFILESIZE: 1048576, LOGFILENUM: 3, FLUSH LEVEL: WARN]]
GRAPHER_CONF: [CHRONO_GRAPHER_CONFIGURATION : RECORDING_GROUP: 7, KEEPER_GRAPHER_DRAIN_SERVICE_CONF: [RPC_IMPLEMENTATION: CHRONOLOG_THALLIUM_SOCKETS, PROTO_CONF: ofi+sockets, IP: 127.0.0.1, BASE_PORT: 3333, SERVICE_PROVIDER_ID: 33, PORTS: ], DATA_STORE_ADMIN_SERVICE_CONF: [RPC_IMPLEMENTATION: CHRONOLOG_THALLIUM_SOCKETS, PROTO_CONF: ofi+sockets, IP: 127.0.0.1, BASE_PORT: 4444, SERVICE_PROVIDER_ID: 44, PORTS: ], VISOR_REGISTRY_SERVICE_CONF: [RPC_IMPLEMENTATION: CHRONOLOG_THALLIUM_SOCKETS, PROTO_CONF: ofi+sockets, IP: 127.0.0.1, BASE_PORT: 8888, SERVICE_PROVIDER_ID: 88, PORTS: ], LOG_CONF:[TYPE: file, FILE: chrono_grapher.log, LEVEL: DEBUG, NAME: ChronoGrapher, LOGFILESIZE: 1048576, LOGFILENUM: 3, FLUSH LEVEL: DEBUG], [DATA_STORE_CONF: max_story_chunk_size :4096], [EXTRACTOR_CONF: STORY_FILES_DIR:/tmp]]
CLIENT_CONF: [VISOR_CLIENT_PORTAL_SERVICE_CONF: [RPC_CONF: [RPC_IMPLEMENTATION: CHRONOLOG_THALLIUM_SOCKETS, PROTO_CONF: ofi+sockets, IP: 127.0.0.1, BASE_PORT: 5555, SERVICE_PROVIDER_ID: 55, PORTS: ]], CLIENT_LOG_CONF:[TYPE: file, FILE: chrono_client.log, LEVEL: DEBUG, NAME: ChronoClient, LOGFILESIZE: 1048576, LOGFILENUM: 3, FLUSH LEVEL: WARN]]
******** End of configuration output ********
[warning] "abt_thread_stacksize" will be ignored because Argobots is already initialized
Generated client id: FNWSTBMP
connected to server address : ofi+sockets://127.0.0.1:5555
Metadata operations:
-c <chronicle_name> , create a Chronicle <chronicle_name>
-a -s <chronicle_name> <story_name>, acquire Story <story_name> in Chronicle <chronicle_name>
-w <event_string>, write Event with <event_string> as payload
-q -s <chronicle_name> <story_name>, release Story <story_name> in Chronicle <chronicle_name>
-d -s <chronicle_name> <story_name>, destroy Story <story_name> in Chronicle <chronicle_name>
-d -c <chronicle_name>, destroy Chronicle <chronicle_name>
-disconnect
Enter command: -c c_1
Enter command: -a -s c_1 s_1
Enter command: -w this is a event payload string
Enter command: -q -s c_1 s_1
Enter command: -d -s c_1 s_1
Enter command: -d -c c_1
Enter command: -disconnect
Total payload written: 0
Time used: 62.2531 seconds
Bandwidth: 0 MB/s
client_admin
can also be run in the script mode when a list of arguments are passed to control how Chronicles, Stories and Events are generated and stored to ChronoLog. We prepared an example of synthetic workload using client_admin
in the script mode in Client/synthetic_workload/distributed_syslog.sh
. It reads syslog
files from multiple nodes and store each line as an Event into ChronoLog