Skip to content

Commit e154442

Browse files
aaronweisslerHenning-Schulzmariusoe
authored
Document all default instrumentations (#1419)
Co-authored-by: Henning Schulz <henning.schulz@novatec-gmbh.de> Co-authored-by: Marius Oehler <marius.oehler@novatec-gmbh.de>
1 parent 777a654 commit e154442

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+463
-142
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
11
inspectit:
22
instrumentation:
33
actions:
4-
4+
55
'a_assign_value':
6+
docs:
7+
since: '1.2.1'
8+
description: 'Returns the input value.'
9+
inputs:
10+
'value': 'The value to return.'
11+
return-value: 'The input value.'
612
input:
713
'value': 'Object'
814
value: 'value'
915

1016
'a_assign_null':
17+
docs:
18+
since: '1.2.1'
19+
description: 'Returns null.'
20+
return-value: 'null'
1121
value-body: 'return null;'
12-
22+
1323
'a_assign_true':
24+
docs:
25+
since: '1.2.1'
26+
description: 'Returns true.'
27+
return-value: 'true'
1428
value: 'Boolean.TRUE'
15-
29+
1630
'a_assign_false':
31+
docs:
32+
since: '1.2.1'
33+
description: 'Returns false.'
34+
return-value: 'false'
1735
value: 'Boolean.FALSE'
18-
36+

inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/actions/_shared/attachment.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ inspectit:
44

55
'a_attachment_get':
66
docs:
7-
description: 'Reads a given attachment from a target object.'
7+
since: '1.2.1'
8+
description: 'Reads the attachment with a given key from a target Object.'
9+
inputs:
10+
'target': 'The target Object.'
11+
'key': 'The key of the attachment.'
12+
return-value: 'The attachment Object.'
813
input:
914
_attachments: 'ObjectAttachments'
1015
'target': 'Object'
@@ -13,7 +18,13 @@ inspectit:
1318

1419
'a_attachment_put':
1520
docs:
16-
description: 'Replaces a given attachment of a target object with a new one, returns the previous value.'
21+
since: '1.2.1'
22+
description: 'Replaces the attachment with a given key of a target object with a new one. Returns the previous value.'
23+
inputs:
24+
'target': 'The target object.'
25+
'key': 'The key of the attachment.'
26+
'value': 'The new value for the attachment.'
27+
return-value: 'The previous value of the replaced attachment.'
1728
input:
1829
_attachments: ObjectAttachments
1930
'target': Object
@@ -23,7 +34,12 @@ inspectit:
2334

2435
'a_attachment_remove':
2536
docs:
26-
description: 'Removes a given attachment from a target object, returning the previously attached value.'
37+
since: '1.2.1'
38+
description: 'Removes a given attachment from a target object. Returns the previous value.'
39+
inputs:
40+
'target': 'The target object.'
41+
'key': 'The key of the attachment.'
42+
return-value: 'The previous value of the removed attachment.'
2743
input:
2844
_attachments: ObjectAttachments
2945
'target': Object

inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/actions/_shared/debug.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ inspectit:
44

55
'a_debug_println':
66
docs:
7-
description: 'Prints a given Object to stdout.'
7+
since: '1.2.1'
8+
description: 'Prints a given object to stdout.'
9+
inputs:
10+
'value': 'The object to print.'
811
input:
912
'value': 'Object'
1013
is-void: true
@@ -13,7 +16,11 @@ inspectit:
1316
1417
'a_debug_println_2':
1518
docs:
16-
description: 'Prints two given Objects to stdout.'
19+
since: '1.2.1'
20+
description: 'Prints two given objects to stdout in the format "A + B".'
21+
inputs:
22+
'a': 'The first object to print.'
23+
'b': 'The second object to print.'
1724
input:
1825
'a': 'Object'
1926
'b': 'Object'

inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/actions/_shared/entrypoint.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
inspectit:
22
instrumentation:
33
actions:
4-
5-
#
4+
65
'a_entrypoint_check':
76
docs:
7+
since: '1.2.1'
88
description: |-
99
Utility function to detect entry methods.
10-
This functions checks if a given "marker" is present on the context.
11-
The marker should be configured for down-propagation.
12-
If the marker is not present, it is added to the context and "true" is returned.
13-
If it is present, false is returned.
14-
E.g. if methodA calls methodB and they both invoke "a_entrypoint_check" with the same marker,
15-
"true" will only be returned for methodA.
10+
This function checks if a given marker is present on the context. The marker should be configured for down-propagation.
11+
If the marker is not present, it is added to the context and 'true' is returned. If it is present, 'false' is returned.
12+
E.g. if methodA calls methodB and they both invoke "a_entrypoint_check" with the same marker, 'true' will only be returned for methodA.
13+
inputs:
14+
'marker': 'The marker.'
15+
return-value: 'True if the marker is not present, false if it is.'
1616
input:
1717
_context: 'InspectitContext'
1818
'marker': 'String'

inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/actions/_shared/logic.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,61 @@ inspectit:
44

55
'a_logic_isNull':
66
docs:
7-
description: 'Returns true, if the given Object is null, false otherwise.'
7+
since: '1.2.1'
8+
description: 'Returns true, if the given object is null, false otherwise.'
9+
inputs:
10+
'value': 'The object to compare.'
11+
return-value: 'True, if the given object is null, false otherwise.'
812
input:
913
'value': 'Object'
1014
value: 'Boolean.valueOf(value == null)'
1115

1216
'a_logic_isNotNull':
1317
docs:
14-
description: 'Returns true, if the given Object is not null, false otherwise.'
18+
since: '1.2.1'
19+
description: 'Returns true, if the given object is not null, false otherwise.'
20+
inputs:
21+
'value': 'The object to compare.'
22+
return-value: 'True, if the given object is not null, false otherwise.'
1523
input:
1624
'value': 'Object'
1725
value: 'Boolean.valueOf(value != null)'
1826

1927
'a_logic_and':
2028
docs:
29+
since: '1.2.1'
2130
description: 'Returns true, if both provided arguments are not null and true.'
31+
inputs:
32+
'a': 'First Boolean.'
33+
'b': 'Second Boolean.'
34+
return-value: 'True, if both provided arguments are not null and true.'
2235
input:
2336
'a': 'Boolean'
2437
'b': 'Boolean'
2538
value: 'Boolean.valueOf((a != null && a.booleanValue()) && (b != null && b.booleanValue()))'
2639

2740
'a_logic_or':
2841
docs:
42+
since: '1.2.1'
2943
description: 'Returns true, if one of the provided arguments is not null and true.'
44+
inputs:
45+
'a': 'First Boolean.'
46+
'b': 'Second Boolean.'
47+
return-value: 'True, if one of the provided arguments is not null and true.'
3048
input:
3149
'a': 'Boolean'
3250
'b': 'Boolean'
3351
value: 'Boolean.valueOf((a != null && a.booleanValue()) || (b != null && b.booleanValue()))'
3452

35-
#
3653
'a_logic_isTrueOrNotNull':
3754
docs:
55+
since: '1.14.0'
3856
description: |-
3957
Returns whether the input value is set or represents a true value.
4058
The action will return true in case a true-Boolean or any other object is passed into the input parameter.
41-
42-
Since: 1.14.0'
59+
inputs:
60+
'value': 'The input value.'
61+
return-value: 'True, if the input value is set or represents a true value.'
4362
input:
4463
'value': 'Object'
4564
value-body: |
@@ -49,4 +68,4 @@ inspectit:
4968
if (value instanceof String) {
5069
return Boolean.valueOf(Boolean.parseBoolean((String) value));
5170
}
52-
return Boolean.valueOf(value != null);
71+
return Boolean.valueOf(value != null);

inspectit-ocelot-config/src/main/resources/rocks/inspectit/ocelot/config/default/instrumentation/actions/_shared/method.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
inspectit:
2-
instrumentation:
2+
instrumentation:
33
actions:
44

55
'a_method_getFQN':
66
docs:
7-
description: 'Returns the full qualified name of the current method, e.g. "my.package.MyClass.myMethod".'
7+
since: '1.2.1'
8+
description: 'Returns the fully qualified name of the current method, e.g. "my.package.MyClass.myMethod".'
9+
return-value: 'The fully qualified name of the current method as a String.'
810
input:
911
_class: 'Class'
1012
_methodName: 'String'
11-
'_parameterTypes': 'Class[]'
13+
_parameterTypes: 'Class[]'
1214
value-body: |
1315
StringBuilder sb = new StringBuilder();
1416
sb.append(_class.getName()).append('.');
@@ -24,10 +26,12 @@ inspectit:
2426
2527
'a_method_getNameWithParameters':
2628
docs:
29+
since: '1.2.1'
2730
description: 'Returns the name of the method with the simple parameter list, e.g. "myMethod(int, String, MyClass)".'
31+
return-value: 'The name of the method with the simple parameter list as a String.'
2832
input:
2933
_methodName: 'String'
30-
'_parameterTypes': 'Class[]'
34+
_parameterTypes: 'Class[]'
3135
value-body: |
3236
StringBuilder sb = new StringBuilder();
3337
sb.append(_methodName).append('(');
@@ -42,7 +46,9 @@ inspectit:
4246
4347
'a_method_getClassFQN':
4448
docs:
45-
description: 'Returns the full qualified name of the class declaring the current method, e.g. "my.package.MyClass".'
49+
since: '1.2.1'
50+
description: 'Returns the fully qualified name of the class declaring the current method, e.g. "my.package.MyClass".'
51+
return-value: 'The fully qualified name of the class declaring the current method.'
4652
input:
4753
_class: 'Class'
4854
value: '_class.getName()'

0 commit comments

Comments
 (0)