Firebase 실시간 데이터베이스 작업 유형

Firebase 실시간 데이터베이스 프로파일러 명령어

실시간 데이터베이스 인스턴스의 작업 속도 및 대역폭 사용량 보고서를 생성하려면 다음 명령어를 사용하세요.

firebase database:profile
플래그 옵션 설명
-h, --help 사용량 정보 출력
-o, --output FILENAME 지정한 파일에 출력 저장
-i, --input FILENAME 서버의 스트림 로그 대신 지정한 파일을 기반으로 보고서 생성
-d, --duration SECONDS 지정한 시간(초) 동안 데이터베이스 사용량 정보 수집
--raw 수집된 원시 통계를 개행문자로 구분된 JSON으로 출력

작업 유형

concurrent-connect

이 작업은 데이터베이스 실시간 연결(예: SDK를 통해 새 클라이언트가 연결될 때)을 반영합니다. RESTful 연결은 동시 연결 작업에 반영되지 않습니다.

{
    "name": "concurrent-connect",
    "timestamp": 1484776334900
}

concurrent-disconnect

끊어진 데이터베이스 연결(예: 클라이언트가 연결을 끊거나 로그아웃할 때)을 반영합니다.

{
    "name": "concurrent-disconnect",
    "timestamp": 1484776341844
}

realtime-write

실시간 연결의 쓰기 요청입니다. 예를 들어 웹 클라이언트의 set()push() 작업입니다. 삭제 요청도 realtime-write 작업으로 계산되며 0바이트 쓰기를 반영합니다.

{
    "allowed": true, // If security rules allow the operation
    "bytes": 1,
    "millis": 2,
    "name": "realtime-write",
    "path": [
        "foo"
    ],
    "timestamp": 1484776538763
}

realtime-transaction

이 작업 유형에는 실시간 연결을 통해 수행되는 트랜잭션이 포함됩니다. 반복 트랜잭션은 실패 후 재시도에 따른 결과일 수 있습니다.

{
    "allowed": true,
    "bytes": 20,
    "millis": 2,
    "name": "realtime-transaction",
    "path": [
        "foo"
    ],
    "timestamp": 1484776854610
}

realtime-update

이러한 실시간 업데이트 작업은 realtime-write의 일반적인 쓰기 작업이 아닌 특정 데이터 덮어쓰기를 반영합니다.

{
    "allowed": true,
    "bytes": 5,
    "millis": 2,
    "name": "realtime-update",
    "path": [
        "foo"
    ],
    "timestamp": 1484776538769
}

listener-listen

이러한 작업은 클라이언트의 특정 위치에서 데이터를 처음 요청하는 작업을 반영합니다. 예를 들어 웹 클라이언트의 on() 또는 once() 메서드입니다.

{
    "allowed": true,
    "bytes": 0,
    "millis": 26,
    "name": "listener-listen",
    "path": [
        "foo"
    ],
    "querySet": [],
    "timestamp": 1484776335024,
    "unIndexed": false
}

listener-broadcast

이 작업은 모든 쓰기 및 업데이트 작업 후 서버에서 특정 위치를 수신 대기하는 모든 클라이언트로 전송하는 데이터를 처리합니다. 데이터 변경은 브로드캐스트 작업으로 이어집니다. 그러나 수신 대기 중인 클라이언트가 없으면 업데이트가 표시되지 않을 수 있습니다.

{
    "bytes": 56, // Total bytes sent across clients
    "clientsUpdated": 3, // This may be 0 if no clients are listening
    "millis": 17,
    "name": "listener-broadcast",
    "path": [
        "baz",
        "mar"
    ],
    "timestamp": 1484775969928
}

listener-unlisten

이 작업은 리슨 중에 로그아웃하거나 분리 메서드(예: 웹의 경우 off(), iOS의 경우 removeAllObservers)를 통해 리슨을 중지하는 클라이언트를 반영합니다.

{
    "name": "listener-unlisten",
    "path": [
        "foo"
    ],
    "timestamp": 1484776335044
}

rest-read

REST API를 통한 GET 요청입니다.

{
    "allowed": true,
    "bytes": 348, // This would be 0 if the read data was null
    "millis": 26,
    "name": "rest-read",
    "path": [],
    "querySet": [
        {
            "default": true,
            "endIndexValue": "[MAX_NAME]",
            "equality": false,
            "index": {},
            "limit": null,
            "range": false,
            "simpleLimit": false,
            "startIndexValue": "[MIN_NAME]",
            "viewFrom": null
        }
    ],
    "timestamp": 1484775747416
}

rest-write

REST API를 통한 PUTPOST 요청입니다. DELETE 요청은 0바이트 rest-write 작업을 반영합니다.

{
    "allowed": true,
    "bytes": 13,
    "millis": 116,
    "name": "rest-write",
    "path": [],
    "timestamp": 1484775917216
}

rest-transaction

트랜잭션 유사 동작의 경우 조건부 요청을 사용하세요. rest-transaction 작업은 Etag 또는 if-match 헤더를 사용하여 요청을 캡처합니다.

{
    "allowed": true,
    "bytes": 13,
    "millis": 116,
    "name": "rest-transaction",
    "path": [],
    "timestamp": 1484775917216
}

rest-update

REST API를 통한 업데이트는 PATCH 요청을 반영합니다.

{
    "allowed": true,
    "bytes": 5,
    "millis": 11,
    "name": "rest-update",
    "path": [
        "baz",
        "mar"
    ],
    "timestamp": 1484775969930
}

on-disconnect-put

이러한 작업은 쓰기 작업에 onDisconnect 리스너 추가를 반영합니다. 예를 들어 onDisconnect().setValue()를 사용하는 경우가 여기에 해당합니다.

{
    "allowed": true,
    "bytes": 4,
    "millis": 2,
    "name": "on-disconnect-put",
    "path": [
        "baz",
        "mar"
    ],
    "timestamp": 1484775969930
}

on-disconnect-update

이 작업은 업데이트 작업에 onDisconnect 리스너 추가를 반영합니다. 예를 들어 onDisconnect().updateChildren()을 사용하는 경우가 여기에 해당합니다.

{
    "allowed": true,
    "bytes": 4,
    "millis": 2,
    "name": "on-disconnect-update",
    "path": [
        "baz",
        "mar"
    ],
    "timestamp": 1484775969930
}

on-disconnect-cancel

이 작업은 onDisconnect 리스너 삭제를 반영합니다. 예를 들어 onDisconnect().set().cancel()을 사용하는 경우가 여기에 해당합니다.

{
    "millis": 2,
    "name": "on-disconnect-cancel",
    "path": [
        "baz",
        "mar"
    ],
    "timestamp": 1484775969930
}

run-on-disconnect

이 작업은 onDisconnect 리스너 트리거를 반영합니다. onDisconnect 리스너를 최소 한 개 이상 추가한 후에 실시간 클라이언트 연결이 끊기면 프로파일러가 단일 run-on-disconnect 작업을 기록하여 트리거된 모든 onDisconnect 리스너의 집계된 바이트와 시간을 반영합니다.

{
    "bytes": 4,
    "millis": 2,
    "name": "run-on-disconnect",
    "timestamp": 1484775969930
}