Compare commits

..

No commits in common. "7bd5b9a253f2240e96f3cf0779d4462753cbf91e" and "fa5a7d821c8fc1ac459a1c157e64217c0ef6eb1b" have entirely different histories.

1 changed files with 27 additions and 27 deletions

54
jilo
View File

@ -192,53 +192,53 @@ jitsi_log_parse() {
# locate conference starting event # locate conference starting event
if [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\ Videobridge\.createConference#[0-9]+:\ create_conf,\ id=([a-zA-Z0-9]+) ]]; then if [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\ Videobridge\.createConference#[0-9]+:\ create_conf,\ id=([a-zA-Z0-9]+) ]]; then
timestamp="${BASH_REMATCH[1]}" timestamp="${BASH_REMATCH[1]}"
conference_id="${BASH_REMATCH[2]}" conferenceId="${BASH_REMATCH[2]}"
start_times["$conference_id"]="$timestamp" start_times["$conferenceId"]="$timestamp"
# locate participant joining event # locate participant joining event
elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conference_id}\ .*epId=([a-zA-Z0-9-]+)\ stats_id=([a-zA-Z0-9-]+)\ .*Starting\ the\ Agent\ without\ remote\ candidates ]]; then elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conferenceId}\ .*epId=([a-zA-Z0-9-]+)\ stats_id=([a-zA-Z0-9-]+)\ .*Starting\ the\ Agent\ without\ remote\ candidates ]]; then
event_time="${BASH_REMATCH[1]}" participant_join_time="${BASH_REMATCH[1]}"
event_type='participant joining' event_type='participant joining'
participant_endpoint_id="${BASH_REMATCH[2]}" participant_endpoint_id="${BASH_REMATCH[2]}"
participant_stats_id="${BASH_REMATCH[3]}" participant_stats_id="${BASH_REMATCH[3]}"
if [[ -n "$conference_id" ]]; then if [[ -n "$conferenceId" ]]; then
db_insert=$(printf "$db_insert_participant_template" "$conference_id" "$event_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "") db_insert=$(printf "$db_insert_participant_template" "$conferenceId" "$participant_join_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "")
db_query "$db_insert" db_query "$db_insert"
fi fi
# locate participant pair selection event # locate participant pair selection event
elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conference_id}\ .*epId=${participant_endpoint_id}\ stats_id=${participant_stats_id}\ .*Selected\ pair\ for\ stream\ .*([0-9.]+):10000/udp/srflx\ \-\>\ ([0-9.]+):[0-9]+/udp/prflx ]]; then elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conferenceId}\ .*epId=${participant_endpoint_id}\ stats_id=${participant_stats_id}\ .*Selected\ pair\ for\ stream\ .*([0-9.]+):10000/udp/srflx\ \-\>\ ([0-9.]+):[0-9]+/udp/prflx ]]; then
event_time="${BASH_REMATCH[1]}" participant_join_time="${BASH_REMATCH[1]}"
event_type='pair selected' event_type='pair selected'
participant_IP="${BASH_REMATCH[3]}" participant_IP="${BASH_REMATCH[3]}"
if [[ -n "$conference_id" ]]; then if [[ -n "$conferenceId" ]]; then
db_insert=$(printf "$db_insert_participant_template" "$conference_id" "$event_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "$participant_IP") db_insert=$(printf "$db_insert_participant_template" "$conferenceId" "$participant_join_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "$participant_IP")
db_query "$db_insert" db_query "$db_insert"
fi fi
# locate participant leaving event # locate participant leaving event
elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conference_id}\ .*epId=${participant_endpoint_id}\ stats_id=${participant_stats_id}\]\ Endpoint\.expire.*:\ Expired\. ]]; then elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=${conferenceId}\ .*epId=${participant_endpoint_id}\ stats_id=${participant_stats_id}\]\ Endpoint\.expire.*:\ Expired\. ]]; then
event_time="${BASH_REMATCH[1]}" participant_join_time="${BASH_REMATCH[1]}"
event_type='participant leaving' event_type='participant leaving'
if [[ -n "$conference_id" ]]; then if [[ -n "$conferenceId" ]]; then
db_insert=$(printf "$db_insert_participant_template" "$conference_id" "$event_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "$participant_IP") db_insert=$(printf "$db_insert_participant_template" "$conferenceId" "$participant_join_time" "$event_type" "$participant_endpoint_id" "$participant_stats_id" "$participant_IP")
db_query "$db_insert" db_query "$db_insert"
# the participant left, forget about him # the participant left, forget about him
unset $event_time $event_type $participant_endpoint_id $participant_stats_id $participant_IP unset $participant_join_time $event_type $participant_endpoint_id $participant_stats_id $participant_IP
fi fi
# locate the corresponding conference ending event # locate the corresponding conference ending event
elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=([a-zA-Z0-9]+)\ .*conf_name=([^ ]+)@.*\]\ Conference\.expire ]]; then elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[confId=([a-zA-Z0-9]+)\ .*conf_name=([^ ]+)@.*\]\ Conference\.expire ]]; then
end_time="${BASH_REMATCH[1]}" end_time="${BASH_REMATCH[1]}"
conference_id="${BASH_REMATCH[2]}" conferenceId="${BASH_REMATCH[2]}"
conference_name="${BASH_REMATCH[3]}" conferenceName="${BASH_REMATCH[3]}"
start_time="${start_times["$conference_id"]}" start_time="${start_times["$conferenceId"]}"
if [[ -n "$start_time" ]]; then if [[ -n "$start_time" ]]; then
db_insert=$(printf "$db_insert_conference_template" "$jitsi_component" "$conference_name" "$conference_id" "$start_time" "$end_time") db_insert=$(printf "$db_insert_conference_template" "$jitsi_component" "$conferenceName" "$conferenceId" "$start_time" "$end_time")
db_query "$db_insert" db_query "$db_insert"
# the conference ended, forget about it # the conference ended, forget about it
unset "start_times[$conference_id]" $start_time $end_time $conference_id $conference_name unset "start_times[$conferenceId]" $statr_time $end_time $conferenceId $conferenceName
fi fi
fi fi
;; ;;
@ -247,20 +247,20 @@ jitsi_log_parse() {
# locate conference starting event # locate conference starting event
if [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[room=([^ ]+)@.*\]\ JitsiMeetConferenceImpl\.joinTheRoom ]]; then if [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[room=([^ ]+)@.*\]\ JitsiMeetConferenceImpl\.joinTheRoom ]]; then
timestamp="${BASH_REMATCH[1]}" timestamp="${BASH_REMATCH[1]}"
conference_name="${BASH_REMATCH[2]}" conferenceName="${BASH_REMATCH[2]}"
start_times["$conference_name"]="$timestamp" start_times["$conferenceName"]="$timestamp"
# locate the corresponding conference ending event # locate the corresponding conference ending event
elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[room=([^ ]+)@.*\ meeting_id=([a-zA-Z0-9-]+)\]\ JitsiMeetConferenceImpl\.stop ]]; then elif [[ "$line" =~ ([0-9-]+\ [0-9:.]+)\ [A-Z]+:.*\[room=([^ ]+)@.*\ meeting_id=([a-zA-Z0-9-]+)\]\ JitsiMeetConferenceImpl\.stop ]]; then
end_time="${BASH_REMATCH[1]}" end_time="${BASH_REMATCH[1]}"
conference_name="${BASH_REMATCH[2]}" conferenceName="${BASH_REMATCH[2]}"
conference_id="${BASH_REMATCH[3]}" conferenceId="${BASH_REMATCH[3]}"
start_time="${start_times["$conference_name"]}" start_time="${start_times["$conferenceName"]}"
if [[ -n "$start_time" ]]; then if [[ -n "$start_time" ]]; then
db_insert=$(printf "$db_insert_conference_template" "$jitsi_component" "$conference_name" "$conference_id" "$start_time" "$end_time") db_insert=$(printf "$db_insert_conference_template" "$jitsi_component" "$conferenceName" "$conferenceId" "$start_time" "$end_time")
db_query "$db_insert" db_query "$db_insert"
unset "start_times[$conference_name]" unset "start_times[$conferenceName]"
fi fi
fi fi
;; ;;