File: Sample.js

package info (click to toggle)
visualvm 2.0.6%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 39,516 kB
  • sloc: java: 306,212; xml: 14,016; javascript: 3,543; ansic: 1,889; cpp: 1,277; sh: 701; makefile: 68
file content (61 lines) | stat: -rw-r--r-- 2,133 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
 * A sample definition file for dynamic tracer
 */

VisualVM.Tracer.addPackages([
    {
        name: "Package 1",
        desc: "Sample package 1",
        icon: "org/graalvm/visualvm/modules/somemodule/resources/myicon.png",
        validator: function() {
            return true; // always enabled
        },
        probes: [
            {
                name: "Probe 1",
                desc: "Sample probe 1",
                properties: [
                    {
                        name: "Property 1",
                        desc: "Sample property 1",
                        value: mbeanAttribute("java.lang:type=Compilation", "CompilationTime"),
                        presenter: {
                            type: "discrete",
                            lineColor: AUTOCOLOR,
                            format: { // custom format
                                getUnits: function(format) {
                                    return "years";
                                }
                            }
                        }
                    },
                    {
                        name: "Property 2",
                        value: function(timestamp) {
                            if (this.counter == undefined) {
                                this.counter = 0;
                            }
                            return this.counter++;
                        }
                    }
                ]
            },
            {
                name: "Probe 2",
                validator: function() { // overriding the availability inherited from the package
                    return false; // never enabled
                },
                properties: [
                    {
                        name: "Property 3",
                        value: NULL_VALUE, // always return 0
                        presenter: {
                            format: ItemValueFormatter.DEFAULT_PERCENT,
                            max: 1000 // required by the DEFAULT_PERCENT formatter
                        }
                    }
                ]
            }
        ]
    }
])