<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg" dir="ltr">
<div class="elementToProof"><br>
</div>
</div>
<ul data-editing-info="{"orderedStyleType":1,"unorderedStyleType":4}">
<li style="font-family: "Microsoft Yahei"; font-size: 14px; line-height: 1.7; list-style-type: "➢ "; color: rgb(0, 0, 0);">
<span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);">Yes. However, not every user likes to implement a throttling mechanism by themselves.</span>
<div style="font-family: "Microsoft Yahei"; font-size: 14px; line-height: 1.7; list-style-type: "➢ "; color: rgb(0, 0, 0);">
<span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);">True, but it doesn't necessarily need to come with the JDK. It can be implemented as a third-party library where many different throttling classes can exist.</span></div>
<div style="font-family: "Microsoft Yahei"; font-size: 14px; line-height: 1.7; list-style-type: "➢ "; color: rgb(0, 0, 0);">
<span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);"><br>
</span></div>
<div style="font-family: "Microsoft Yahei"; font-size: 14px; line-height: 1.7; list-style-type: "➢ "; color: rgb(0, 0, 0);">
<div class="elementToProof"><span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);">IMO, the main benefit of a standardized throttling mechanism is that JMC, or other tools, knows the mechanics, so they can provide
</span><span style="letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">appropriate</span><span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);"> visualization.
 Users need to know if every event is displayed, or only one out of a hundred.</span></div>
</div>
<div style="font-family: "Microsoft Yahei"; font-size: 14px; line-height: 1.7; list-style-type: "➢ "; color: rgb(0, 0, 0);">
<span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);"><br>
</span></div>
</li><li style="font-family: "Microsoft Yahei"; font-size: 14px; line-height: 1.7; list-style-type: "➢ "; color: rgb(0, 0, 0);">
<span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);">The specific implementation method can be discussed further, if this feature is indeed necessary to be implemented at the JDK layer.</span>
<div style="font-family: "Microsoft Yahei"; font-size: 14px; line-height: 1.7; list-style-type: "➢ "; color: rgb(0, 0, 0);">
<div class="elementToProof"><span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);">What makes throttling tricky is that there are so many ways to do it. For example, how should an event with a threshold be throttled? All events?
</span><span style="letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Only those above the threshold?
</span><span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);">Only those below the threshold? Configurable?</span></div>
</div>
</li></ul>
<div class="elementToProof" style="line-height: 1.7;"><span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);">I can see how a throttling mechanism similar to jdk.ObjectAllocation can be useful for direct memory allocation. It may
 make sense to reuse what's available in native, if feasible. The native implementation has been designed so it can easily be extended for other events. </span></div>
<div class="elementToProof" style="line-height: 1.7;"><span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof" style="line-height: 1.7;"><span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);">Not sure how the RPC events work, but sometimes it can be more useful to sample per request/transaction and get all events
 for that request/transaction, rather than throttle per event type.</span></div>
<div class="elementToProof" style="line-height: 1.7;"><span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof" style="line-height: 1.7;"><span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);">Erik</span></div>
<div style="line-height: 1.7; margin-right: 0px; margin-left: 40px;"><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; color: rgb(0, 0, 0);">------------------------------------------------------------------</span></div>
<div style="line-height: 1.7; margin-right: 0px; margin-left: 40px;"><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; color: rgb(0, 0, 0);">From:Erik Gahlin <erik.gahlin@oracle.com></span></div>
<div style="line-height: 1.7; margin-right: 0px; margin-left: 40px;"><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; color: rgb(0, 0, 0);">Send Time:2023年11月16日(星期四) 05:01</span></div>
<div style="line-height: 1.7; margin-right: 0px; margin-left: 40px;"><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; color: rgb(0, 0, 0);">To:hotspot-jfr-dev <hotspot-jfr-dev@openjdk.java.net>; 董登辉(卓昂) <denghui.ddh@alibaba-inc.com></span></div>
<div style="line-height: 1.7; margin-right: 0px; margin-left: 40px;"><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; color: rgb(0, 0, 0);">Subject:Re: RFD: Throttling Support for Java-Level JFR Events</span></div>
<div style="line-height: 1.7; margin-right: 0px; margin-left: 40px;"><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; color: rgb(0, 0, 0);"><br>
</span></div>
<div style="line-height: 1.7; margin-right: 0px; margin-left: 40px;"><span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);">Hi
</span><span style="letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Denghui</span><span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);">,</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);"><br>
</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);">It's been considered it, but we like to see a few real use cases before
 adding it.</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);"><br>
</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);">Do you see a use case for JDK events or for user defined events?</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);"><br>
</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);">If user defined, could you describe the events?</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);"><br>
</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);">The JFR API allows users to create their own throttling mechanism using
 the SettingControl class.</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);"><br>
</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);">We are aware of that exception and I/O events could potentially benefit
 from throttling, but not sure the mechanism should work similar to native events. There is also visualization aspects to take into consideration. JMC would need to be updated so it can differentiate between outliers or throttling.</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);"><br>
</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);">Thanks,</span></div>
<div style="text-align: left; line-height: 1.7; margin: 0px 0px 0px 40px; background-color: rgb(255, 255, 255);">
<span style="letter-spacing: normal; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; font-weight: 400; color: rgb(0, 0, 0);">Erik</span></div>
<div style="line-height: 1.7; margin-right: 0px; margin-left: 40px; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0);">
<br>
</div>
<div id="x_appendonsend"></div>
<hr style="line-height: 1.7; margin-right: 0px; margin-left: 40px; display: inline-block; width: 98%;">
<div id="x_divRplyFwdMsg"><span style="font-family: Calibri, sans-serif; font-size: 15px; color: rgb(0, 0, 0);"><b>From:</b> hotspot-jfr-dev <hotspot-jfr-dev-retn@openjdk.org> on behalf of Denghui Dong <denghui.ddh@alibaba-inc.com><br>
<b>Sent:</b> Wednesday, November 15, 2023 9:20 AM<br>
<b>To:</b> hotspot-jfr-dev <hotspot-jfr-dev@openjdk.java.net><br>
<b>Subject:</b> RFD: Throttling Support for Java-Level JFR Events</span>
<div> </div>
</div>
<div style="line-height: 1.7; margin-right: 0px; margin-left: 40px;"><span style="font-family: "Microsoft Yahei"; font-size: 14px; color: rgb(0, 0, 0);">Hi team,</span></div>
<div style="text-align: left; line-height: 1.7; white-space: normal; margin: 0px 0px 0px 40px; padding: 0px; border-width: 0px; border-style: none; border-color: currentcolor; letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0);">
<span style="letter-spacing: normal;"><br>
</span></div>
<div style="text-align: left; line-height: 1.7; white-space: normal; margin: 0px 0px 0px 40px; padding: 0px; border-width: 0px; border-style: none; border-color: currentcolor; letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0);">
<span style="letter-spacing: normal;">We have observed increased adoption of JFR for information collection within our internal applications and frameworks.</span></div>
<div style="text-align: left; line-height: 1.7; white-space: normal; margin: 0px 0px 0px 40px; padding: 0px; border-width: 0px; border-style: none; border-color: currentcolor; letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0);">
<span style="letter-spacing: normal;"><br>
</span></div>
<div style="text-align: left; line-height: 1.7; white-space: normal; margin: 0px 0px 0px 40px; padding: 0px; border-width: 0px; border-style: none; border-color: currentcolor;">
<span style="letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0);">However, we've encountered situations where critical events occur frequently, prompting us to explore</span></div>
<div style="text-align: left; line-height: 1.7; white-space: normal; margin: 0px 0px 0px 40px; padding: 0px; border-width: 0px; border-style: none; border-color: currentcolor;">
<span style="letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0);">the possibility of introducing a throttling mechanism for Java-level events.</span></div>
<div style="text-align: left; line-height: 1.7; white-space: normal; margin: 0px 0px 0px 40px; padding: 0px; border-width: 0px; border-style: none; border-color: currentcolor;">
<span style="letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0);"><br>
</span></div>
<div style="text-align: left; line-height: 1.7; white-space: normal; margin: 0px 0px 0px 40px; padding: 0px; border-width: 0px; border-style: none; border-color: currentcolor;">
<span style="letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0);">Currently, my understanding is that throttling is exclusively supported for native event ObjectAllocationSample.</span></div>
<div style="text-align: left; line-height: 1.7; white-space: normal; margin-right: 0px; margin-left: 40px; padding-right: 0px; padding-left: 0px;">
<span style="letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0);">Should we consider extending this feature to Java-level events?</span></div>
<div style="text-align: left; line-height: 1.7; white-space: normal; margin: 0px 0px 0px 40px; padding: 0px; border-width: 0px; border-style: none; border-color: currentcolor; letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0);">
<span style="letter-spacing: normal;"><br>
</span></div>
<div style="text-align: left; line-height: 1.7; white-space: normal; margin: 0px 0px 0px 40px; padding: 0px; border-width: 0px; border-style: none; border-color: currentcolor; letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0);">
<span style="letter-spacing: normal;">Thanks,</span></div>
<div style="text-align: left; line-height: 1.7; white-space: normal; margin: 0px 0px 0px 40px; padding: 0px; border-width: 0px; border-style: none; border-color: currentcolor; letter-spacing: normal; font-family: "Microsoft Yahei"; font-size: 14px; font-weight: 400; color: rgb(0, 0, 0);">
<span style="letter-spacing: normal;">Denghui Dong</span></div>
</body>
</html>