-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add stats for total Jibri failures
The following JSON keys will be added to the stats: "total_live_streaming_failures" "total_recording_failures" "total_sip_call_failures"
- Loading branch information
1 parent
a126bf5
commit 82ff6f4
Showing
13 changed files
with
460 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
src/main/java/org/jitsi/jicofo/recording/jibri/JibriSessionEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright @ 2018 - present 8x8, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
package org.jitsi.jicofo.recording.jibri; | ||
|
||
import org.jitsi.eventadmin.*; | ||
|
||
import java.util.*; | ||
|
||
/** | ||
* Events emitted for {@link JibriSession}. | ||
*/ | ||
public class JibriSessionEvent extends Event | ||
{ | ||
/** | ||
* Event emitted when a {@link JibriSession} fails to start. | ||
*/ | ||
public static final String FAILED_TO_START | ||
= "org/jitsi/jicofo/jibri/session/FAILED_TO_START"; | ||
|
||
/** | ||
* A key holding the {@link Type}. | ||
*/ | ||
private static final String TYPE_KEY = "TYPE"; | ||
|
||
/** | ||
* Creates new {@link JibriSessionEvent} with the {@link #FAILED_TO_START} | ||
* topic. | ||
* | ||
* @param type - Tells which {@link Type} of Jibri session is the new event | ||
* for. | ||
*/ | ||
static public JibriSessionEvent newFailedToStartEvent(Type type) | ||
{ | ||
Dictionary<String, Object> props = new Hashtable<>(1); | ||
|
||
props.put(TYPE_KEY, type); | ||
|
||
return new JibriSessionEvent(FAILED_TO_START, props); | ||
} | ||
|
||
/** | ||
* Creates new instance. | ||
* @param topic - The event's topic. | ||
* @param properties - The event's properties. | ||
*/ | ||
public JibriSessionEvent(String topic, Dictionary properties) | ||
{ | ||
super(topic, properties); | ||
} | ||
|
||
/** | ||
* @return {@code true} if the event comes for a SIP Jibri session or | ||
* {@code false} otherwise. | ||
*/ | ||
public Type getType() | ||
{ | ||
Object type = getProperty(TYPE_KEY); | ||
|
||
return type instanceof Type ? (Type) type : null; | ||
} | ||
|
||
/** | ||
* A Jibri session type. | ||
*/ | ||
public enum Type { | ||
/** | ||
* SIP Jibri call. | ||
*/ | ||
SIP_CALL, | ||
/** | ||
* Jibri live streaming session. | ||
*/ | ||
LIVE_STREAMING, | ||
/** | ||
* Jibri recording session. | ||
*/ | ||
RECORDING | ||
} | ||
} |
Oops, something went wrong.