MLab的webthingscompliant网络测量工具。

murakami的Python项目详细描述


村上春树

村上春树是一个工具,用于创建一个自动化的互联网测量服务,运行在一个Docker容器中。村上春树测量容器可以配置为使用随机计划每天自动运行四次支持的测试,并将每个测试结果导出到本地存储设备、通过SCP导出到一个或多个远程服务器或Google云存储桶。结果以JSON新行格式(.jsonl)保存为单个文件。在

支持的测量测试

村上部署方案

村上春树在支持的系统上支持三种类型的容器部署场景:

支持的操作系统

村上支持Linux操作系统,如Ubuntu、Debian等,不支持Windows。macos可以作为独立设备来支持,但与Webthings接口不完全兼容。Balena cloud尚未在Mac OS上进行测试。在

待办事项:在MacOS上测试部署

村上配置和定制

Murkami容器可以根据部署场景灵活配置。如果您只需在Dockerhub上使用M-Lab的预构建映像运行村上容器,默认情况下,所有测试都配置为每天随机运行四次,但没有启用数据导出器。本节重点介绍可以使用文件murakami.toml或使用环境变量配置哪些选项。本文件后面几节提供了示例。在

村上集装箱可以定制使用:

  • 运行docker时命令行上的环境变量(独立、本地管理)
  • 文件中的环境变量,在运行docker时通过命令行传递(独立的,本地管理的)
  • 自定义murakami.toml配置文件(独立、本地管理、Balena Cloud)
  • Balena Cloud项目中的环境变量,或每设备(Balena Cloud)

下表总结了您可以在murakami.toml中配置的选项,以及如何在命令行将这些选项格式化为命令行变量。在

murakami.tomlcorresponding environment variableoptions/examplesfunction
[settings]
port = 80MURAKAMI_SETTINGS_PORT80, 8080Sets the web port used by the Murakami WebThing code
loglevel = "DEBUG"MURAKAMI_SETTINGS_LOGLEVELDEBUG, ?, ?Sets the log level for the Murakami service
immediate = 1MURAKAMI_SETTINGS_IMMEDIATE0, 1, true, falseIf set to ^{} or ^{}, instructs the container to run the first set of tests when it starts
location = "Baltimore"MURAKAMI_SETTINGS_LOCATIONany stringOptional - If set, value is used in exported test file names.
network_type = "home"MURAKAMI_SETTINGS_NETWORK_TYPEany stringOptional - If set, value is used in exported test file names
connection_type = "wired"MURAKAMI_SETTINGS_CONNECTION_TYPEany stringOptional - If set, value is used in exported test file names
[exporters]The 'exporters' configuration sections OR environment variables define where test data should be saved or exported. For each exporter all variables listed must be defined.
[exporters.local]The 'local' exporter defines where on the system's local disk to save test results.
type = "local"MURAKAMI_EXPORTERS_LOCAL_TYPElocal
enabled = trueMURAKAMI_EXPORTERS_LOCAL_ENABLED0, 1, true, false
path = "/data/"MURAKAMI_EXPORTERS_LOCAL_PATHAny system path available to the Murakami container service may be used to save local data.
[exporters.scp]The 'scp' exporter defines a remote server where data should be copied. The server must be configured to allow secure copy via SSH using a private key file.
type = "scp"MURAKAMI_EXPORTERS_SCP_TYPEscp
enabled = trueMURAKAMI_EXPORTERS_SCP_ENABLED0, 1, true, false
target = "myserver.com:system/path/"MURAKAMI_EXPORTERS_SCP_TARGEThostname:path/Defines the remote server and system path where the SCP exporter should save data. A server's IP address is also supported.
port = 22MURAKAMI_EXPORTERS_SCP_PORT22, alternate SCP port used by the remote serverDefines the port used by the remote server for the server's SCP/SSH service.
username = "murakami"MURAKAMI_EXPORTERS_SCP_USERNAMEremote server usernameDefines the username to be used by the SCP exporter.
private_key = "/murakami/keys/id_rsa_murakami"MURAKAMI_EXPORTERS_SCP_PRIVATE_KEYThe system path within the Murakami container where the SCP user's private SSH key is located.
[exporters.gcs]The 'gcs' exporter defines a storage bucket in a Google Cloud Storage project where test data should be saved.
type = "gcs"MURAKAMI_EXPORTERS_GCS_TYPEgcs
enabled = trueMURAKAMI_EXPORTERS_GCS_ENABLED0, 1, true, false
target = "gs://murakami-gcs-test/"MURAKAMI_EXPORTERS_GCS_TARGETgs://bucketnameDefines the GCS storage bucket name where data should be stored.
service_account = "murakami-test-gcs@mlab-sandbox.iam.gserviceaccount.com"MURAKAMI_EXPORTERS_GCS_SERVICE_ACCOUNTThe name of the GCS service account which has access to write data to the GCS storage bucket.
key = "/murakami/keys/murakami-gcs-serviceaccount.json"MURAKAMI_EXPORTERS_GCS_KEYThe system path within the Murakami container where the GCS service account's JSON keyfile is located.

支持多种类型的导出器。例如,如果要定义两个不同的SCP服务器或GCS存储桶,其中应导出数据,则配置文件导出器部分可能如下所示:

[exporters]

  [exporters.gcs1]
  type = "gcs"
  enabled = true
  target = "gs://murakami-storage-bucket-archive/"
  service_account = "murakami-test-gcs@mlab-sandbox.iam.gserviceaccount.com"
  key = "/murakami/keys/murakami-gcs-serviceaccount.json"

  [exporters.gcs2]
  type = "gcs"
  enabled = true
  target = "gs://murakami-storage-bucket-access/"
  service_account = "murakami-test-gcs@mlab-sandbox.iam.gserviceaccount.com"
  key = "/murakami/keys/murakami-gcs-serviceaccount.json"

或作为环境变量:

^{pr2}$

M-Lab支持Dockerhub图像和标记

TO DO描述我们如何为不同的系统架构构造标签。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Spring启动测试中的java MockBean注释导致NonuniqueBeandDefinitionException   java Spring Hateoas调试模板不能为null   递归培根游戏Java程序?   java在Android中保存少量数据(对象)的最简单方法是什么?   异常处理Java中finally块的要点是什么?   是java。util。货币真的是工厂方法模式吗?   java如何输入字符以停止循环   java如何对流的某些部分执行缩减操作   java new Gson()。单例类的toJson(object)返回null   java Itext泰米尔字体显示不正确   java运行时。getRuntime()。gpg命令不起作用的exec()   java如何在preparedstatemenet中将字符连接到SQL字符串   java将同一实体的多个表示形式与lazyload合并时出错   JavaSpring、Hibernate和JPA:在entitymanager上调用persist似乎并没有提交到数据库   java osgi r6服务。组成部分注释属性列表