Go to main content

手册页部分 1:用户命令

退出打印视图

更新时间: 2018年8月8日 星期三
 
 

sstore(1)

名称

sstore - 统计信息存储管理实用程序

用法概要

/usr/bin/sstore [-?]

/usr/bin/sstore help [subcommand]

/usr/bin/sstore capture [-aH]
	 [statid ... | -f ssid_file |
	 [interval [count]]

/usr/bin/sstore export [-F format] [-aH]
	 [[[-t start-time] [-e end-time] [-i step]] |
	 [[-t start-time] [-p relative-pts]]]
	 [statid ... | -f ssid_file]

/usr/bin/sstore list [-F format] [-aH]
	 [[[-t start-time] [-e end-time]] |
	 [[-t start-time] [-p relative-pts]]]
	 [statid ... | -f ssid_file]

/usr/bin/sstore info [-F format] [-a]
	 [[[-t start-time] [-e end-time]] |
	 [[-t start-time] [-p relative-pts]]]
	 [statid ... | -f ssid_file]

描述

sstore 命令能够捕获、导出和显示统计信息系统信息库中包含的统计信息和事件信息。

选项

支持以下选项:

-?

显示用法消息。

命令/子命令选项

除非另有说明,否则所有子命令均支持以下选项:

–F format

指定备用输出格式。format 值可以为 tsv(Tab Separated Values,制表符分隔值)、csv(Comma Separated Values,逗号分隔值)、json(单行 JavaScript 对象表示法)或 json-formatted(格式易于阅读的 JavaScript 对象表示法)。对于 csv 格式化输出,查询必须包括时间范围(请参见 –t 选项)和粒度或步进(秒)。

CSV 输出格式在 sstore.csv(5) 手册页中进行了介绍。JSON 输出格式在 sstore.json(5) 手册页中介绍。

–a

使通配符匹配所有条目(缺省情况下隐藏 unstableunbrowsable 标识符)。

–H

在输出中省略标题。

–f ssid_file

包含标识符列表(每行一个标识符)的文件或 JSON(JavaScript 对象表示法)格式的文件,该格式与 sstore export 命令提供的格式相同。如果指定此选项,则不能直接指定标识符。

–t start-time

%Y-%m-%dT%H:%M:%S 格式指定开始时间戳。有关更多信息,请参见 strftime(3C) 手册页。可以使用关键字 now 指定当前时间。除非另有说明,否则未指定时此选项缺省为 epoch

可以通过两种方式指定时间范围:

形式 1:-t start-time -e end-time -i step

如果指定了 –t 但未指定 –p,则始终认为是第一种形式。如果采用此形式,则返回的数据由开始和结束时间限定,并且最小粒度为 step

形式 2:-t start-time -p relative-pts

第二种形式在达到最大 relative-pts 数据点时返回,并且不保证粒度。可以指定正值或负值,分别表示返回的点在 start-time 之后或之前。

–e end-time

指定结束时间戳(有关格式的信息,请参见 –t)。指定了 –t 但未指定 –p 时,如果未指定此选项,则此选项缺省为 now

–i step

指定两个时间戳之间的间隔(以秒为单位)。对于指定的所有非零 step,将插补数据,以便数据点之间的时间戳准确相隔 step 秒。

如果 step 为零或未指定,则返回的数据所带时间戳来自 sstored 初始抽样且未经修改。缺省情况下,sstored 尝试每秒抽样统计信息一次,但有时可能会失败,具体取决于系统的装入情况。请参见 sstored(8) 手册页。

–p relative-pts

指定要返回的最大数据点数。此值必须为非零值。可以指定可选的 start-time。如果未指定 start-time,则开始时间缺省为 now

操作数

statid

统计信息存储标识符 (statistics store identifier, SSID)。要指定多个标识符,应使用空格分隔标识符,或使用通配符或拼接,如使用 Oracle Solaris 11.4 分析中所述。

子命令

支持以下子命令:

sstore help subcommand

此命令显示指定 sstore 子命令或所有 sstore 子命令的用法。

要显示特定子命令的用法,请使用 sstore help 命令并将该特定子命令作为操作数。

如果使用不带任何操作数的 sstore help 命令,则显示所有 sstore 子命令的用法。

sstore capture [–aH] [statid ...| –f ssid_file] [interval [count]]

此子命令捕获并输出给定标识符的统计信息和事件信息,直到进程终止。

如果指定 interval,则每隔 interval 秒输出一次结果,直到按 Ctrl-C 终止进程。

如果您指定了 count,则在输出结果 count 次后进程终止。


注 - 要显示可用资源、统计信息、事件及其标识符,请使用 sstore list 命令。
sstore export [–F format] [–aH] [[[–t start-time] [–e end-time] [–i step]] | [[–t start-time] [–p relative-pts]]] [statid ... | –f ssid_file]

此子命令输出给定时间范围内给定标识符的历史统计信息和事件信息。

必须至少指定一个属标识符。时间范围是可选的。如果您不指定时间范围,则输出给定标识符的所有数据。

sstore list [–F format] [–aH] [[[–t start-time] [–e end-time] | [[–t start-time] [–p relative-pts]]] [statid ...| –f ssid_file]

此子命令输出匹配标识符的列表。

如果未指定 –t,则假定 now 是开始时间值,sstore list 命令将输出当前可用的标识符列表。

如果您指定了 –t,则还输出 activity 的范围,它指明可以捕获标识符的时间。因此,–t 选项还可用于查看系统上的资源在过去何时可用。

sstore info [–F format] [–a] [[[–t start-time] [–e end-time] | [[–t start-time] [–p relative-pts]]] [statid ...| –f ssid_file]

此子命令显示有关给定标识符的信息。

时间范围指定行为与 sstore list 命令对应的行为相同。

示例

有关 //:op//:fmt 的示例,请参见 ssid-op(7) 手册页。

示例 1 每五秒记录统计信息两次

此示例记录 CPU 整数管道使用情况(在具有两个导线束的内核区域中),每五秒显示当前 stat 值两次。

$ sstore capture '//:class.cpu//:res.id/*//:stat.integer-pipe-usage' 5 2
TIME                VALUE IDENTIFIER
2014-10-08T14:42:06 104501725 //:class.cpu//:res.id/0//:stat.integer-pipe-usage
2014-10-08T14:42:06 110927532 //:class.cpu//:res.id/1//:stat.integer-pipe-usage
2014-10-08T14:42:11 123515733 //:class.cpu//:res.id/0//:stat.integer-pipe-usage
示例 2 在先前捕获后导出统计信息值

此示例在先前启用捕获八秒后导出数据链路 net0 的历史统计信息。

$ sstore export '//:class.link/phys//:res.name/net0//:stat.//:s.[out-bytes,in-bytes]'
TIME                VALUE IDENTIFIER
2014-10-08T15:13:46 1073914647 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:47 1073915035 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:48 1073915713 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:49 1073916959 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:50 1073917089 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:51 1073920729 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:52 1073922289 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:53 1073923069 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:47 4226366841 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:48 4226367123 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:49 4226367773 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:50 4226368179 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:51 4226372059 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:52 4226373961 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:53 4226375257 //:class.link/phys//:res.name/net0//:stat.in-bytes
示例 3 列出可用的 CPU 统计信息和事件
$ sstore list '//:class.cpu//:res.id/0//://:s.[stat,event].*'
IDENTIFIER            
//:class.cpu//:res.id/0//:stat.usage
//:class.cpu//:res.id/0//:stat.integer-pipe-usage
//:class.cpu//:res.id/0//:stat.interrupt-count
//:class.cpu//:res.id/0//:stat.interrupt-time
//:class.cpu//:res.id/0//:stat.xcalls
//:class.cpu//:res.id/0//:event.adm-action
//:class.cpu//:res.id/0//:event.alert
//:class.cpu//:res.id/0//:event.fault
示例 4 显示有关网络统计信息的信息
$ sstore info //:class.link/phys//:res.name/net0//:stat.ifspeed
 Identifier: //:class.link/phys//:res.name/net0//:stat.ifspeed
description: maximum received or transmitted bytes/s
  copyright: Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  stability: stable
   max-rate: //:stat.ifspeed
 multiplier: 8
      units: bytes
    $schema: //:stat
       type: rate
         id: //:class.link/phys//:stat.ifspeed
示例 5 显示有关网络和 CPU 资源的信息
$ sstore info //:class.link/phys//:res.name/net0 //:class.cpu//:res.id/0   
 Identifier: //:class.link/phys//:res.name/net0
  stability: stable
description: data link instance

 Identifier: //:class.cpu//:res.id/0
  stability: stable
description: cpu instance

退出状态

将返回以下退出值:

0

命令成功。

1

出现错误。

2

指定的命令行选项无效。

3

请求了多项操作,但只有一部分操作成功。

99

出现意外错误。

属性

有关下列属性的说明,请参见 attributes(7):

属性类型
属性值
可用性
system/sstore
接口稳定性
Uncommitted(未确定)

另请参见

libsstore(3LIB)ssid-metadata(7)、ssid-op(7)sstoreadm(1)sstored(8)

使用 Oracle Solaris 11.4 分析