Difference between revisions of "Adding a computed measurement/zh-cn"

From Senfi Docs
Jump to: navigation, search
(Created page with "=== 先决条件 === 计算的测量是需要进行设计和逻辑编程,才能使其正常运作。如果这是您第一次创建计算的测量,请先阅读Computed_me...")
(Created page with "您还应该熟悉基本测量及其概念。如果需要复习,请阅读本节。")
Line 3: Line 3:
 
计算的测量是需要进行设计和逻辑编程,才能使其正常运作。如果这是您第一次创建计算的测量,请先阅读[[Computed_measurement|本指南]]。
 
计算的测量是需要进行设计和逻辑编程,才能使其正常运作。如果这是您第一次创建计算的测量,请先阅读[[Computed_measurement|本指南]]。
  
You should also be similar with the basic [[Measurement|measurements]] and its concepts. Please read [[Concepts#Measurement.2C_Metric.2C_Tag|this section]] if you require a refresher.
+
您还应该熟悉基本[[Measurement|测量]]及其概念。如果需要复习,请阅读[[Concepts#Measurement.2C_Metric.2C_Tag|本节]]
  
 
You should  
 
You should  

Revision as of 11:19, 6 November 2019

先决条件

计算的测量是需要进行设计和逻辑编程,才能使其正常运作。如果这是您第一次创建计算的测量,请先阅读本指南

您还应该熟悉基本测量及其概念。如果需要复习,请阅读本节

You should

  • Note down the input measurements.
  • Note down the metrics you want to output.
  • Decide on a set of tags to use or re-use. Make sure that there is a combination of tags that will uniquely identify the unit/device/equipment that outputs those metrics.
  • Have the computed measurement script ready.
  • (Optional) Have a set of test data for your computed measurement

Adding a New Computed Measurement

  1. Login to the CMS
  2. Go to the Computed Measurement tab
  3. Click the + button to add a new computed measurement.
  4. Give the measurement a descriptive name. This will be shown to users of the dashboard.
  5. Specify a measurement code.
  6. Select your Input Measurements
  7. Add tags.
  8. Add metrics and specify the type of each metric.
  9. Write the computed measurement script. See Writing the Computed Measurement Script for more details.
  10. (Optional) Test the computed measurement. See Testing the Computed Measurement for more details.
  11. Save when done.
Note: The computed measurement will be instantiated and run immediately upon saving.

Writing the Computed Measurement Script

Fill in the script of your computed measurement in the Script editor. When you add a new computed measurement, a template script will be pre-filled for you.

  1. Fill in init(), the initialization function
  2. Fill in compute(), the computation function
  3. Declare any global variables, if your script requires them
Note: You should not modify the function signatures of the initialization or computation functions.
Tip: The script editor will interactively notify you of any syntax errors in your script.

Testing the Computed Measurement

  1. Enter sample measurement data in the Testing Value editor
  2. Click the TEST button
  3. After 5 seconds, review the test output in the Testing Output panel and any console messages in the Testing Console panel.