mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Enforce minimum value for mqtt stats update (#12253)
This commit is contained in:
parent
ef7846bb41
commit
012aa63571
@ -26,6 +26,7 @@ from frigate.const import (
|
|||||||
CACHE_DIR,
|
CACHE_DIR,
|
||||||
CACHE_SEGMENT_FORMAT,
|
CACHE_SEGMENT_FORMAT,
|
||||||
DEFAULT_DB_PATH,
|
DEFAULT_DB_PATH,
|
||||||
|
FREQUENCY_STATS_POINTS,
|
||||||
MAX_PRE_CAPTURE,
|
MAX_PRE_CAPTURE,
|
||||||
REGEX_CAMERA_NAME,
|
REGEX_CAMERA_NAME,
|
||||||
YAML_EXT,
|
YAML_EXT,
|
||||||
@ -193,7 +194,9 @@ class MqttConfig(FrigateBaseModel):
|
|||||||
port: int = Field(default=1883, title="MQTT Port")
|
port: int = Field(default=1883, title="MQTT Port")
|
||||||
topic_prefix: str = Field(default="frigate", title="MQTT Topic Prefix")
|
topic_prefix: str = Field(default="frigate", title="MQTT Topic Prefix")
|
||||||
client_id: str = Field(default="frigate", title="MQTT Client ID")
|
client_id: str = Field(default="frigate", title="MQTT Client ID")
|
||||||
stats_interval: int = Field(default=60, title="MQTT Camera Stats Interval")
|
stats_interval: int = Field(
|
||||||
|
default=60, ge=FREQUENCY_STATS_POINTS, title="MQTT Camera Stats Interval"
|
||||||
|
)
|
||||||
user: Optional[str] = Field(None, title="MQTT Username")
|
user: Optional[str] = Field(None, title="MQTT Username")
|
||||||
password: Optional[str] = Field(None, title="MQTT Password", validate_default=True)
|
password: Optional[str] = Field(None, title="MQTT Password", validate_default=True)
|
||||||
tls_ca_certs: Optional[str] = Field(None, title="MQTT TLS CA Certificates")
|
tls_ca_certs: Optional[str] = Field(None, title="MQTT TLS CA Certificates")
|
||||||
|
@ -82,6 +82,10 @@ UPSERT_REVIEW_SEGMENT = "upsert_review_segment"
|
|||||||
CLEAR_ONGOING_REVIEW_SEGMENTS = "clear_ongoing_review_segments"
|
CLEAR_ONGOING_REVIEW_SEGMENTS = "clear_ongoing_review_segments"
|
||||||
UPDATE_CAMERA_ACTIVITY = "update_camera_activity"
|
UPDATE_CAMERA_ACTIVITY = "update_camera_activity"
|
||||||
|
|
||||||
|
# Stats Values
|
||||||
|
|
||||||
|
FREQUENCY_STATS_POINTS = 15
|
||||||
|
|
||||||
# Autotracking
|
# Autotracking
|
||||||
|
|
||||||
AUTOTRACKING_MAX_AREA_RATIO = 0.6
|
AUTOTRACKING_MAX_AREA_RATIO = 0.6
|
||||||
|
@ -10,6 +10,7 @@ from typing import Optional
|
|||||||
|
|
||||||
from frigate.comms.inter_process import InterProcessRequestor
|
from frigate.comms.inter_process import InterProcessRequestor
|
||||||
from frigate.config import FrigateConfig
|
from frigate.config import FrigateConfig
|
||||||
|
from frigate.const import FREQUENCY_STATS_POINTS
|
||||||
from frigate.stats.util import stats_snapshot
|
from frigate.stats.util import stats_snapshot
|
||||||
from frigate.types import StatsTrackingTypes
|
from frigate.types import StatsTrackingTypes
|
||||||
|
|
||||||
@ -17,7 +18,6 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
MAX_STATS_POINTS = 80
|
MAX_STATS_POINTS = 80
|
||||||
FREQUENCY_STATS_POINTS = 15
|
|
||||||
|
|
||||||
|
|
||||||
class StatsEmitter(threading.Thread):
|
class StatsEmitter(threading.Thread):
|
||||||
|
Loading…
Reference in New Issue
Block a user