2.9. メトリック
3scale toolbox を使用して、デベロッパーポータルのメトリクスの作成、更新、一覧表示、および削除を行います。
2.9.1. メトリクスの作成
メトリクスを作成するには、以下の手順に従います。
- メトリクス名を指定する必要があります。
-
system-nameを上書きするには、オプションのパラメーターを使用します。 - 同じ名前のメトリクスがすでに存在する場合、エラーメッセージが表示されます。
--disabledフラグを使用して、無効なメトリクスを作成します。-
デフォルトでは、
有効になります。
-
デフォルトでは、
注記
service位置引数はサービスの参照で、サービスのidまたはサービスのsystem_nameのどちらかです。- toolbox は、どちらか一方を使用します。
以下のコマンドにより、メトリクスが作成されます。
3scale metric create [opts] <remote> <service> <metric-name>
メトリクスの作成時に、以下のオプションを使用します。
Options
--description=<value> This will set a metric description
--disabled This will disable this metric in all application plans
-t --system-name=<value> This will set the application plan system name
--unit=<value> Metric unit: default hit
Option for metric
-c --config-file=<value> 3scale toolbox configuration file
(default: $HOME/.3scalerc.yaml)
-h --help show help for this command
-k --insecure Proceed and operate even for server
connections otherwise considered insecure
-v --version This will print the version of this command
--verbose Verbose mode2.9.2. メトリクスの作成または更新
メトリクスが存在しない場合に新しく作成する、または既存のメトリクスを更新するには、以下の手順に従います。
- 同じ名前のメトリクスがすでに存在する場合、エラーメッセージが表示されます。
-
--disabledフラグを使用して、無効なメトリクスを更新します。 -
--enabledフラグを使用して、有効なメトリクスに更新します。
注記
service位置引数はサービスの参照で、サービスのidまたはサービスのsystem_nameのどちらかです。- toolbox は、どちらか一方を使用します。
metric位置引数はメトリクス参照で、メトリクスのidまたはメトリクスのsystem_nameのどちらかです。- toolbox は、どちらか一方を使用します。
以下のコマンドにより、メトリクスが更新されます。
3scale metric apply [opts] <remote> <service> <metric>
メトリクスの更新時に、以下のオプションを使用します。
Options
--description=<value> This will set a metric description
--disabled This will disable this metric in all application plans
--enabled This will enable this metric in all application plans
-n --name=<value> This will set the metric name
--unit=<value> Metric unit: default hit
Options for metric
-c --config-file=<value> 3scale toolbox configuration file
(default: $HOME/.3scalerc.yaml)
-h --help show help for this command
-k --insecure Proceed and operate even for server
connections otherwise considered insecure
-v --version This will print the version of this command
--verbose Verbose mode2.9.3. メトリクスの一覧表示
以下のコマンドにより、メトリクスが一覧表示されます。
3scale metric list [opts] <remote> <service>
メトリクスの一覧表示時に、以下のオプションを使用します。
Options for metric
-c --config-file=<value> 3scale toolbox configuration file
(default: $HOME/.3scalerc.yaml)
-h --help show help for this command
-k --insecure Proceed and operate even for server
connections otherwise considered insecure
-v --version This will print the version of this command
--verbose Verbose mode2.9.4. メトリクスの削除
以下のコマンドにより、メトリクスが削除されます。
3scale metric delete [opts] <remote> <service> <metric>
メトリクスの削除時に、以下のオプションを使用します。
Options for metric
-c --config-file=<value> 3scale toolbox configuration file
(default: $HOME/.3scalerc.yaml)
-h --help show help for this command
-k --insecure Proceed and operate even for server
connections otherwise considered insecure
-v --version This will print the version of this command
--verbose Verbose mode