zoukankan      html  css  js  c++  java
  • [转]Creating a Data Collector Set with the PLA API

    http://www.devx.com/dotnet/Article/35157/0/page/3

    Creating a data collector set programmatically takes only a few lines of code when you have an appropriately configured XML template already available. You can use the template you just created as a base; modify the path variable in the code below to suit your needs:

       using PlaLibrary;
       
       ...
       
       // Load the XML template
       string path = @"C:\Development\DevX.Pla\DevX.Pla.Template.xml";
       StreamReader reader = File.OpenText(path);
       string templateXml = reader.ReadToEnd();
       reader.Close();
       
       // Create the data collector set
       IDataCollectorSet collectorSet = new DataCollectorSetClass();
       collectorSet.SetXml(templateXml);
       
       // Save the data collector set for later use
       string name = @"Service\DevX (Created with the PLA API)";
       collectorSet.Commit(name, null, CommitMode.plaCreateOrModify);
       
    

    Use the IDataCollectorSet.SetXml method as shown in the preceding code to configure the data collector set with an XML template. You can also configure the data collector set manually through exposed IDataCollectorSet properties, such as IDataCollectorSet.OutputLocation and IDataCollectorSet.RootPath.

     
    Figure 8: Commit Method: Use the IDataCollectorSet.Commit method to save a collector set for later use.

    The IDataCollectorSet.Commit method saves the data collector set. Here's the syntax for a Commitcall:

       IDataCollectorSet.Commit(string name, 
          string server, CommitMode mode);
    

    Data collector sets you save with the Commit method will appear next to other user defined data collector sets in the RPM (see Figure 8).
    The Commitmethod provides powerful mechanisms for deploying and reusing data collector sets through its three parameters, described in Table 1.

    Table 1.IDataCollectorSet.Commit Parameters: The parameters for the Commit method provide powerful mechanisms for deploying and reusing data collector sets.
    Parameter Allowed Values Description
    name Service\<name> Sets created by the user; can be scheduled and set to run as anyone.
    System\<name> Read-only sets; cannot be scheduled.
    Legacy\<name> Sets running on operating systems prior to Vista.
    Session\<name> Special-purpose namespace for Event Tracing sessions.
    Autosession\<name> Special-purpose namespace for Event Tracing AutoLogger sessions.
    server Computer name, fully qualified domain name, IP address (IPv4 or IPv6), or null for the local computer. Computer on which to save the data collector set.
    mode plaCreateNew Creates a new set; fails if it already exists.
    plaModify Modifies an existing set; fails if it doesn't already exist.
    plaCreateOrModify Creates a new set or updates it if it already exists.
    plaUpdateRunningInstance Applies new properties to the running set instance.
    plaFlushTrace Applies only to sets with Event Tracing sessions.
    plaValidateOnly Validates the set's properties.
  • 相关阅读:
    在CentOS7上部署Kubernetes集群
    使用Ansible部署etcd 3.2高可用集群
    shiro框架学习-3- Shiro内置realm
    shiro框架学习-2-springboot整合shiro及Shiro认证授权流程
    shiro框架学习-1-shiro基本概念
    markdown编辑器常用命令
    华为云服务器centos7.3安装tomcat
    华为云服务器centos7.3 安装jdk
    springboot2.0+mysql整合mybatis,发现查询出来的时间比数据库datetime值快了8小时
    使用IDEA自动生成Java实体类
  • 原文地址:https://www.cnblogs.com/swanestle/p/2664042.html
Copyright © 2011-2022 走看看