|
SOMHunter Core
|
Class responsible for all the logging for the given user (each user have it's own Logger.)
More...
#include <logger.h>

Public Member Functions | |
| Logger ()=delete | |
| Logger (const EvalServerSettings &settings, const UserContext *p_user_ctx, EvalServerClient *p_eval_server) | |
| ~Logger () noexcept | |
| void | poll () |
| Does periodic cleanup & log flush. More... | |
| void | log_search_context_switch (std::size_t dest_context_ID, size_t src_context_ID) |
| void | log_submit (const VideoFrame frame, bool submit_result) |
| Called whenever we want to log submit frame/shot into the server. More... | |
| void | log_query (const LogHash &hash, const Query &query) const |
| Logs the provided query as a whole. More... | |
| void | log_canvas_query (const std::vector< TemporalQuery > &temp_queries, const std::vector< VideoFrame > *p_targets) |
| void | log_rescore (const Query &prev_query, const Query &new_query) |
| void | log_results (const DatasetFrames &_dataset_frames, const ScoreModel &scores, const std::set< FrameId > &likes, const UsedTools &used_tools, DisplayType disp_type, const std::vector< FrameId > &topn_imgs, const std::string &sentence_query, const size_t topn_frames_per_video, const size_t topn_frames_per_shot, const std::vector< bool > &dataset_parts_filter={ true, true }) |
| Called whenever we rescore. More... | |
| void | log_text_query_change (const std::string &query_sentence) |
| void | log_canvas_query_change () |
| void | log_like (FrameId frame_ID) |
| void | log_unlike (FrameId frame_ID) |
| void | log_bookmark (FrameId frame_ID) |
| void | log_unbookmark (FrameId frame_ID) |
| void | log_show_som_display (const DatasetFrames &_dataset_frames, const std::vector< FrameId > &imgs) |
| void | log_show_som_relocation_display (const DatasetFrames &_dataset_frames, const std::vector< FrameId > &imgs) |
| void | log_show_random_display (const DatasetFrames &_dataset_frames, const std::vector< FrameId > &imgs) |
| void | log_show_topn_display (const DatasetFrames &_dataset_frames, const std::vector< FrameId > &imgs) |
| void | log_show_topn_context_display (const DatasetFrames &_dataset_frames, const std::vector< FrameId > &imgs) |
| void | log_show_topknn_display (const DatasetFrames &_dataset_frames, FrameId frame_ID, const std::vector< FrameId > &imgs) |
| void | log_show_detail_display (const DatasetFrames &_dataset_frames, FrameId frame_ID) |
| void | log_show_video_replay (const DatasetFrames &_dataset_frames, FrameId frame_ID, float delta) |
| void | log_scroll (const DatasetFrames &_dataset_frames, DisplayType from_disp_type, float dirY) |
| void | log_reset_search () |
| void | submit_interaction_logs_buffer () |
Sends the accumulated logs to the evaluation server (through _p_eval_server). More... | |
| DebugLogStreamPtrs | get_debug_streams () |
| void | clear_debug_streams () |
Private Member Functions | |
| void | log_bothlike (FrameId frame_ID, const std::string &type) |
| LogHash | gen_action_hash (UnixTimestamp ts) |
| LogHash | push_action (const std::string &action_name, const std::string &cat, const std::string &type, const std::string &value, nlohmann::json &&our_log_JSON={}, std::initializer_list< std::string > summary_keys={}) |
| void | write_result (const nlohmann::json &action_log) |
| Writes the log into the local file. More... | |
| void | write_action (const nlohmann::json &action_log) |
| Writes the log into the local file. More... | |
| void | write_summary (const nlohmann::json &log, const std::string &action_name, std::initializer_list< std::string > keys={}) |
| Writes the log into the local file. More... | |
| std::string | get_log_dir_queries () const |
| std::string | get_results_log_filepath () const |
| std::string | get_actions_log_filepath () const |
| std::string | get_summary_log_filepath () const |
| std::lock_guard< std::mutex > | get_exclusive_actions_lock () const |
Private Attributes | |
| const EvalServerSettings | _logger_settings |
| const UserContext * | _p_user_ctx |
| EvalServerClient * | _p_eval_server |
| std::vector< nlohmann::json > | _interactions_buffer |
| UnixTimestamp | _last_interactions_submit_ts |
| std::ofstream | _results_log_stream |
| std::ofstream | _summary_log_stream |
| std::ofstream | _actions_log_stream |
| std::vector< std::stringstream > | _summary_streams |
| std::vector< std::stringstream > | _actions_streams |
| std::vector< std::stringstream > | _results_streams |
| bool | _first_result { true } |
| bool | _first_actions { true } |
| std::mutex | _push_action_mtx |
Class responsible for all the logging for the given user (each user have it's own Logger.)
|
delete |
| Logger::Logger | ( | const EvalServerSettings & | settings, |
| const UserContext * | p_user_ctx, | ||
| EvalServerClient * | p_eval_server | ||
| ) |

|
noexcept |

|
inline |
|
private |

|
private |

|
inline |
|
inlineprivate |
|
private |

|
private |

|
private |

| void Logger::log_bookmark | ( | FrameId | frame_ID | ) |

|
private |

| void Logger::log_canvas_query | ( | const std::vector< TemporalQuery > & | temp_queries, |
| const std::vector< VideoFrame > * | p_targets | ||
| ) |

| void Logger::log_canvas_query_change | ( | ) |

| void Logger::log_like | ( | FrameId | frame_ID | ) |

Logs the provided query as a whole.

| void Logger::log_reset_search | ( | ) |

| void Logger::log_results | ( | const DatasetFrames & | _dataset_frames, |
| const ScoreModel & | scores, | ||
| const std::set< FrameId > & | likes, | ||
| const UsedTools & | used_tools, | ||
| DisplayType | disp_type, | ||
| const std::vector< FrameId > & | topn_imgs, | ||
| const std::string & | sentence_query, | ||
| const size_t | topn_frames_per_video, | ||
| const size_t | topn_frames_per_shot, | ||
| const std::vector< bool > & | dataset_parts_filter = { true, true } |
||
| ) |
Called whenever we rescore.

| void Logger::log_scroll | ( | const DatasetFrames & | _dataset_frames, |
| DisplayType | from_disp_type, | ||
| float | dirY | ||
| ) |

| void Logger::log_search_context_switch | ( | std::size_t | dest_context_ID, |
| size_t | src_context_ID | ||
| ) |

| void Logger::log_show_detail_display | ( | const DatasetFrames & | _dataset_frames, |
| FrameId | frame_ID | ||
| ) |

| void Logger::log_show_random_display | ( | const DatasetFrames & | _dataset_frames, |
| const std::vector< FrameId > & | imgs | ||
| ) |

| void Logger::log_show_som_display | ( | const DatasetFrames & | _dataset_frames, |
| const std::vector< FrameId > & | imgs | ||
| ) |

| void Logger::log_show_som_relocation_display | ( | const DatasetFrames & | _dataset_frames, |
| const std::vector< FrameId > & | imgs | ||
| ) |

| void Logger::log_show_topknn_display | ( | const DatasetFrames & | _dataset_frames, |
| FrameId | frame_ID, | ||
| const std::vector< FrameId > & | imgs | ||
| ) |

| void Logger::log_show_topn_context_display | ( | const DatasetFrames & | _dataset_frames, |
| const std::vector< FrameId > & | imgs | ||
| ) |

| void Logger::log_show_topn_display | ( | const DatasetFrames & | _dataset_frames, |
| const std::vector< FrameId > & | imgs | ||
| ) |

| void Logger::log_show_video_replay | ( | const DatasetFrames & | _dataset_frames, |
| FrameId | frame_ID, | ||
| float | delta | ||
| ) |

| void Logger::log_submit | ( | const VideoFrame | frame, |
| bool | submit_result | ||
| ) |
Called whenever we want to log submit frame/shot into the server.

| void Logger::log_text_query_change | ( | const std::string & | query_sentence | ) |

| void Logger::log_unbookmark | ( | FrameId | frame_ID | ) |

| void Logger::log_unlike | ( | FrameId | frame_ID | ) |

| void Logger::poll | ( | ) |
Does periodic cleanup & log flush.

|
private |

| void Logger::submit_interaction_logs_buffer | ( | ) |
Sends the accumulated logs to the evaluation server (through _p_eval_server).

|
inlineprivate |
Writes the log into the local file.
|
inlineprivate |
Writes the log into the local file.
|
inlineprivate |
Writes the log into the local file.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |