Skip to content

Commit

Permalink
Enable JMX metrics for resource groups by default
Browse files Browse the repository at this point in the history
  • Loading branch information
polomek authored and hashhar committed Mar 5, 2024
1 parent 8f22aa0 commit 74e3ffa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class InternalResourceGroup
@GuardedBy("root")
private SchedulingPolicy schedulingPolicy = FAIR;
@GuardedBy("root")
private boolean jmxExport;
private boolean jmxExport = true;

// Live data structures
// ====================
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/admin/resource-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ are reflected automatically for incoming queries.
{ref}`scheduleweight-example`.

- `jmxExport` (optional): If true, group statistics are exported to JMX for monitoring.
Defaults to `false`.
Defaults to `true`.

- `subGroups` (optional): list of sub-groups.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void testConfiguration()
assertEqualsResourceGroup(global, "1MB", 1000, 100, 100, WEIGHTED, DEFAULT_WEIGHT, true, Duration.ofHours(1), Duration.ofDays(1));
InternalResourceGroup sub = global.getOrCreateSubGroup("sub");
manager.configure(sub, new SelectionContext<>(sub.getId(), new ResourceGroupIdTemplate("global.sub")));
assertEqualsResourceGroup(sub, "2MB", 4, 3, 3, FAIR, 5, false, Duration.ofMillis(Long.MAX_VALUE), Duration.ofMillis(Long.MAX_VALUE));
assertEqualsResourceGroup(sub, "2MB", 4, 3, 3, FAIR, 5, true, Duration.ofMillis(Long.MAX_VALUE), Duration.ofMillis(Long.MAX_VALUE));
}

@Test
Expand Down Expand Up @@ -197,14 +197,14 @@ public void testReconfig()
InternalResourceGroup globalSub = global.getOrCreateSubGroup("sub");
manager.configure(globalSub, new SelectionContext<>(globalSub.getId(), new ResourceGroupIdTemplate("global.sub")));
// Verify record exists
assertEqualsResourceGroup(globalSub, "2MB", 4, 3, 3, FAIR, 5, false, Duration.ofMillis(Long.MAX_VALUE), Duration.ofMillis(Long.MAX_VALUE));
dao.updateResourceGroup(2, "sub", "3MB", 2, 1, 1, "weighted", 6, true, "1h", "1d", 1L, ENVIRONMENT);
assertEqualsResourceGroup(globalSub, "2MB", 4, 3, 3, FAIR, 5, true, Duration.ofMillis(Long.MAX_VALUE), Duration.ofMillis(Long.MAX_VALUE));
dao.updateResourceGroup(2, "sub", "3MB", 2, 1, 1, "weighted", 6, false, "1h", "1d", 1L, ENVIRONMENT);
do {
MILLISECONDS.sleep(500);
}
while (globalSub.getJmxExport() == false);
while (globalSub.getJmxExport() == true);
// Verify update
assertEqualsResourceGroup(globalSub, "3MB", 2, 1, 1, WEIGHTED, 6, true, Duration.ofHours(1), Duration.ofDays(1));
assertEqualsResourceGroup(globalSub, "3MB", 2, 1, 1, WEIGHTED, 6, false, Duration.ofHours(1), Duration.ofDays(1));
// Verify delete
dao.deleteSelectors(2);
dao.deleteResourceGroup(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"softMemoryLimit": "2MB",
"hardConcurrencyLimit": 3,
"maxQueued": 4,
"schedulingWeight": 5
"schedulingWeight": 5,
"jmxExport": false
}
]
}
Expand Down

0 comments on commit 74e3ffa

Please sign in to comment.