コード例 #1
0
  static {
    String statName = "DiskDirStatistics";
    String statDescription = "Statistics about a single disk directory for a region";

    final String diskSpaceDesc =
        "The total number of bytes currently being used on disk in this directory for oplog files.";
    final String maxSpaceDesc =
        "The configured maximum number of bytes allowed in this directory for oplog files. Note that some product configurations allow this maximum to be exceeded.";
    StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton();

    type =
        f.createType(
            statName,
            statDescription,
            new StatisticDescriptor[] {
              f.createLongGauge("diskSpace", diskSpaceDesc, "bytes"),
              f.createLongGauge("maximumSpace", maxSpaceDesc, "bytes"),
              f.createLongGauge(
                  "volumeSize", "The total size in bytes of the disk volume", "bytes"),
              f.createLongGauge(
                  "volumeFreeSpace", "The total free space in bytes on the disk volume", "bytes"),
              f.createLongCounter(
                  "volumeFreeSpaceChecks", "The total number of disk space checks", "checks"),
              f.createLongCounter(
                  "volumeFreeSpaceTime", "The total time spent checking disk usage", "nanoseconds")
            });

    // Initialize id fields
    diskSpaceId = type.nameToId("diskSpace");
    maxSpaceId = type.nameToId("maximumSpace");
    volumeSizeId = type.nameToId("volumeSize");
    volumeFreeSpaceId = type.nameToId("volumeFreeSpace");
    volumeFreeSpaceChecksId = type.nameToId("volumeFreeSpaceChecks");
    volumeFreeSpaceTimeId = type.nameToId("volumeFreeSpaceTime");
  }
コード例 #2
0
 static {
   StatisticsTypeFactory f = StatisticsTypeFactoryImpl.singleton();
   myType =
       f.createType(
           "OSXProcessStats",
           "Statistics on a OS X process.",
           new StatisticDescriptor[] {f.createIntGauge("dummyStat", "Placeholder", "megabytes")
             //                              f.createIntGauge("imageSize",
             //                                             "The size of the process's image in
             // megabytes.",
             //                                             "megabytes"),
             //                            f.createIntGauge("rssSize",
             //                                             "The size of the process's resident set
             // size in megabytes.",
             //                                             "megabytes"),
           });
   //    checkOffset("imageSize", imageSizeINT);
   //    checkOffset("rssSize", rssSizeINT);
 }