{
    "STATS": {
        "summary": "Returns information about a function during execution.",
        "complexity": "O(1)",
        "group": "scripting",
        "since": "7.0.0",
        "arity": 2,
        "container": "FUNCTION",
        "function": "functionStatsCommand",
        "command_flags": [
            "NOSCRIPT",
            "ALLOW_BUSY"
        ],
        "acl_categories": [
            "SCRIPTING"
        ],
        "command_tips": [
            "NONDETERMINISTIC_OUTPUT",
            "REQUEST_POLICY:ALL_SHARDS",
            "RESPONSE_POLICY:SPECIAL"
        ],
        "reply_schema": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "running_script": {
                    "description": "Information about the running script.",
                    "oneOf": [
                        {
                            "description": "If there's no in-flight function.",
                            "type": "null"
                        },
                        {
                            "description": "A map with the information about the running script.",
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "name": {
                                    "description": "The name of the function.",
                                    "type": "string"
                                },
                                "command": {
                                    "description": "The command and arguments used for invoking the function.",
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "duration_ms": {
                                    "description": "The function's runtime duration in milliseconds.",
                                    "type": "integer"
                                }
                            }
                        }
                    ]
                },
                "engines": {
                    "description": "A map when each entry in the map represent a single engine.",
                    "type": "object",
                    "patternProperties": {
                        "^.*$": {
                            "description": "Engine map contains statistics about the engine.",
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "libraries_count": {
                                    "description": "Number of libraries.",
                                    "type": "integer"
                                },
                                "functions_count": {
                                    "description": "Number of functions.",
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
