メインコンテンツ

mps-status

Windows システム、Linux システム、および macOS システムでコマンド ラインからサーバー インスタンスのステータスを表示する

構文

mps-status [-C [path/]server_name][--statistics|-s [sample_interval]] [--json|-j]

説明

mps-status [-C [path/]server_name][--statistics|-s [sample_interval]] [--json|-j] は、サーバー インスタンスの絶対パスと共に、サーバーのステータス (STARTEDSTOPPED) を表示します。さらに、以下のような、サーバーに関するパフォーマンスの統計を表示できます。

  • サンプル間隔 (ミリ秒)

  • CPU 使用率

  • アクティブなワーカー プロセスの数

  • キュー内のリクエスト数

  • メモリ使用量

  • 1 秒あたりのリクエスト スループット

  • 合計キュー時間 (ミリ秒)

入力引数

-C path/

サーバー インスタンスへのパスを指定します。このオプションを省略すると、現在の作業フォルダーとその親が検索されて、サーバー インスタンスが検出されます。

server_name

ステータスがクエリされるサーバー

--statistics [sample_interval], -s [sample_interval]

統計の収集と表示を行うかどうかを指定します。

オプションの sample_interval では、統計を収集する間隔をミリ秒で指定できます。既定は 500 です。

メモ

サンプル間隔を 0 に指定すると、サンプルは 1 つだけ取得されます。CPU 使用率やスループットなどの統計を計算するには、2 つのサンプルが必要です。

--json, -j

統計を、次のように JSON 形式で出力することを指定します。

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Instance Status",
    "description": "Status and Statistics for a MATLAB Production
                    Server Instance",
    "type": "object",
    "properties": {
        "instancePath": {
            "description": "Filesystem path for the server 
                            instance",
            "type": "string"
        },
        "started": {
            "type": "boolean"
        },
        "license": {
            "type": "object",
            "properties": {
                "status": {
                    "enum": [ "CHECKED_OUT", "IN_GRACE_PERIOD",
                              "GRACE_PERIOD_EXPIRED" ]
                },
                "type": {
                    "enum": [ "INVALID", "UNKNOWN", "COMPILED", 
                              "TRIAL", "EDU", "COMM" ]
                },
                "number": {"type": "string"}
            },
            "required": ["status"]
        },
        "statistics": {
            "type": "object",
            "properties": {
                "sampleIntervalMS": {
                    "description": "The difference in upTime 
                                    between the two samples, 0 if
                                    only a single sample was
                                    taken",
                    "type": "number"
                },
                "localTime": {
                    "description": "Local Time at server in format 
                                    YYYY.MM.DD HH.MM.SS.SSSSSS",
                    "type": "string"
                },
                "upTime": {
                    "description": "Time since server start in
                                    fractional seconds",
                    "type": "number"
                },
                "cpuTime": {
                    "description": "CPU time consumed by all server
                                    processes in fractional 
                                    seconds",
                    "type": "number"
                },
                "cpuPercentage": {
                    "description": "CPU utilzation, computed using
                                    change in cpuTime and upTime
                                    between two samples",
                    "type": "number"
                },
                "totalRequestsReceived": {
                    "description": "The number of valid requests
                                    received",
                    "type": "integer"
                },
                "totalRequestsStarted": {"type": "integer"},
                "totalRequestsFailedToStart": {
                    "description": "The number of requests that
                                    could not be started",
                    "type": "integer"
                },
                "totalRequestsFinishedHttpSuccess": {
                    "type": "integer"
                },
                "totalRequestsFinishedHttpError": {
                    "description": "Note: does not includes
                                    requests that failed to start",
                    "type": "integer"
                },
                "memoryWorkingSet": {
                    "description": "Amount of memory resident in
                                    physical memory for all
                                    processes (KiB)",
                    "type": "number"
                },
                "throughput": {
                    "description": "Requests retired per second,
                                    computed using the number of
                                    requests finished or failed to
                                    start over two samples",
                    "type": "number"
                },
                "totalQueueTimeMS": {
                    "description": "Sum of the wait times for
                                    currently queued requests",
                    "type": "number"
                }
            }
        }
    },
    "required": ["instancePath", "started"]
}

すべて展開する

tmp フォルダーに存在するサーバー インスタンス server_1 のステータスを表示します。

システム コマンド プロンプトで、次のように入力します。

mps-status -C /tmp/server_1

サーバーが実行中であり、有効なライセンスで実行されている場合、以下を出力します。

'/tmp/server_1' STARTED
license checked out

サーバーが実行されていない場合、以下を出力します。

'/tmp/server_1' STOPPED

tmp フォルダーに存在するサーバー インスタンス server_1 の統計を表示します。

システム コマンド プロンプトで、次のように入力します。

mps-status -C /tmp/server_1 -s
サーバーが実行中であり、有効なライセンスで実行されている場合:

'/tmp/server_1' STARTED
license checked out
Statistics:
Sample Interval (ms):     500
CPU Utilization (%):      40
Active Worker Processes:  2
Requests in Queue:        1
Memory Usage (KiB):       1024
Throughput (requests/s):  10
Total Queue Time (ms):    100

tmp フォルダーに存在するサーバー インスタンス server_1 の統計を表示します。

システム コマンド プロンプトで、次のように入力します。

mps-status -C /tmp/server_1 -s -j
サーバーが実行中であり、有効なライセンスで実行されている場合:

{
    "instancePath":"L:\\MPS\\stats",
    "license":{
        "number":"unknown",
        "status":"CHECKED_OUT",
        "type":"COMM"
    },
    "started":true,
    "statistics":{
        "cpuPercentage":0,
        "cpuTime":1.7628113000000001,
        "localTime":"2015.04.28 16:52:49.874483",
        "memoryWorkingSet":393468,
        "sampleIntervalMS":500.31748899999951,
        "throughput":0,
        "totalQueueTimeMS":0,
        "totalRequestsFailedToStart":0,
        "totalRequestsFinishedHttpError":0,
        "totalRequestsFinishedHttpSuccess":0,
        "totalRequestsReceived":0,
        "totalRequestsStarted":0,
        "upTime":6.9780032949999997
    }
}

バージョン履歴

R2012b で導入