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.
  • 相关阅读:
    .Net WebApi接口之Swagger UI 隐藏指定接口类或方法
    .Net WebApi接口之Swagger集成详解
    SVN服务器的本地搭建和使用
    MemCache在.NET中使用Memcached.ClientLibrary详解
    Memcache分布式锁
    MemCache可视化客户端管理及监控工具TreeNMS
    Redis可视化客户端管理及监控工具TreeNMS
    MemCache服务安装配置及windows下修改端口号
    MemCache在win7上的可视化配置以及Nodejs/Net应用
    Redis分布式锁
  • 原文地址:https://www.cnblogs.com/swanestle/p/2664042.html
Copyright © 2011-2022 走看看