Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.31 KB | None | 0 0
  1. public SqlStatisticsHolderMemoryQuotas(QueryMemoryManager memMgr, GridMetricManager metricMgr) {
  2.         MetricRegistry quotasMetrics = metricMgr.registry(SQL_QUOTAS_REG_NAME);
  3.        
  4.         quotaRequestedCnt = quotasMetrics.longAdderMetric("requests",
  5.             "How many times memory quota have been requested on this node by all the queries in total. " +
  6.                 "Always 0 if sql memory quotas are disabled.");
  7.  
  8.         quotasMetrics.register("maxMem",
  9.             new LongSupplier() {
  10.                 @Override public long getAsLong() {
  11.                     return memMgr.maxMemory();
  12.                 }
  13.             },
  14.             "How much memory in bytes it is possible to reserve by all the queries in total on this node. " +
  15.                 "Negative value if sql memory quotas are disabled. " +
  16.                 "Individual queries have additional per query quotas."
  17.         );
  18.  
  19.         quotasMetrics.register("freeMem",
  20.             new LongSupplier() {
  21.                 @Override public long getAsLong() {
  22.                     return memMgr.maxMemory() - memMgr.memoryReserved();
  23.                 }
  24.             },
  25.             "How much memory in bytes currently left available for the queries on this node. " +
  26.                 "Negative value if sql memory quotas are disabled."
  27.         );
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement