<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 6/28/23 03:23, Rohit Pai wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:LV2PR12MB60148354AAD9D6E65F2B1419CD24A@LV2PR12MB6014.namprd12.prod.outlook.com">
      
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
        {font-family:"Google Sans Mono";
        panose-1:0 0 0 0 0 0 0 0 0 0;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-ligatures:standardcontextual;}p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-ligatures:standardcontextual;}span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri",sans-serif;}.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoPlainText">Hello, <o:p></o:p></p>
        <p class="MsoPlainText"><o:p> </o:p></p>
        <p class="MsoPlainText">Below I have the proposal for a simple
          algorithm which seem to work for the sensors names we have in
          our platforms.
          <o:p></o:p></p>
        <p class="MsoPlainText">Any feedback on making it more generic
          and reusable would be appreciated.
        </p>
      </div>
    </blockquote>
    <p>I am currently in the process of a different solution. Instead of
      using an algorithm, which is either going to come up with a very
      mangled solution (50 char example below), or an algorithm that may
      mistakenly generate duplicate sensor names, we're proposing adding
      a "ShortName" entry to the JSON configuration file read by Entity
      Manager. Doing so allows each company to decide for themselves how
      they want the name to appear.<br>
    </p>
    <p>For example:<br>
      "Name": "CPU_ADC_Controller",<br>
      "ShortName": "CPU_ADC_Ctrlr",</p>
    <p>The long example below might be represented by a human like this:<br>
      "Name": "ProcessorModule_0_MemCntl_0_PageRetirementCountl_0",<br>
      "ShortName": "PM0_MC0_PgRC0"<br>
      This is 13 chars, and leaves room for regex replacement of the '0'
      characters to allow for PM1_MC0, PM0_MC2, etc...<br>
      <br>
      This also does away with the current solution that erases specific
      strings, which increases the probability of a sensor name
      collision.<br>
       constexpr std::array<const char*, 7> suffixes = {<br>
           "_Output_Voltage", "_Input_Voltage", "_Output_Current",
      "_Input_Current",<br>
           "_Output_Power",   "_Input_Power",   "_Temperature"};<br>
    </p>
    <blockquote type="cite" cite="mid:LV2PR12MB60148354AAD9D6E65F2B1419CD24A@LV2PR12MB6014.namprd12.prod.outlook.com">
      <div class="WordSection1">
        <p class="MsoPlainText"><o:p></o:p></p>
        <p class="MsoPlainText"><o:p> </o:p></p>
        <p class="MsoPlainText">Step 1: Split the given name into sub
          words using predefined delimiter set, remove all delimiters,
          and combine the sub words, remember the position of the
          delimiters. Some examples of delimiter are _, space, -,
          camelCase pattern, etc. Combine the words without delimiters
          and exit if the new string is less than 16 chars.
          <o:p></o:p></p>
        <p class="MsoPlainText">Step 2: Start from the first sub word
          and repeat for all the sub words.  <o:p></o:p></p>
        <p class="MsoPlainText">               2.1: if the sub word
          character length is less than allowed_min_char_length then
          skip and leave it as it is.  <o:p></o:p></p>
        <p class="MsoPlainText">               2.2: else remove all the
          characters from the sub word which appear after the offset
          allowed_min_char_length<o:p></o:p></p>
        <p class="MsoPlainText">               2.3: Stop the
          abbreviation process if the total length of the new string is
          less than 16 chars.
          <o:p></o:p></p>
        <p class="MsoPlainText">Step 3: Start by setting threshold as (
          allowed_min_char_length - 1 ) and repeat by decreasing
          threshold by 1 in each iteration until it reaches value 1.
          <o:p></o:p></p>
        <p class="MsoPlainText">               3.1: if the sub word
          character length is less than threshold then skip and leave it
          as it is. 
          <o:p></o:p></p>
        <p class="MsoPlainText">               3.2: else remove all the
          characters from the sub word which appear after the offset
          threshold.
          <o:p></o:p></p>
        <p class="MsoPlainText">               3.3: Stop the
          abbreviation process if the total length of the new string is
          less than 16 chars.<o:p></o:p></p>
        <p class="MsoPlainText">Step 4    Remove sub words starting from
          the first sub word until we reach last sub word or if the
          total length of the new string is less than 16 chars.<o:p></o:p></p>
        <p class="MsoPlainText"><o:p> </o:p></p>
        <p class="MsoPlainText">Some unit test data with
          allowed_min_char_length set to value 5.
          <o:p></o:p></p>
        <p class="MsoPlainText"><o:p> </o:p></p>
        <table class="MsoNormalTable" style="border-collapse:collapse" width="0" cellspacing="0" cellpadding="0" border="0">
          <tbody>
            <tr style="height:15.75pt">
              <td style="border:solid #CCCCCC 1.0pt;padding:1.5pt 2.25pt
                1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">Length
                    <o:p></o:p></span></p>
              </td>
              <td style="border:solid #CCCCCC
                1.0pt;border-left:none;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">Input
                    Names<o:p></o:p></span></p>
              </td>
              <td style="border:solid #CCCCCC
                1.0pt;border-left:none;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">New
                    Length
                    <o:p></o:p></span></p>
              </td>
              <td style="border:solid #CCCCCC
                1.0pt;border-left:none;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">Short
                    Names
                    <o:p></o:p></span></p>
              </td>
            </tr>
            <tr style="height:15.75pt">
              <td style="border:solid #CCCCCC
                1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">14<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">CPU_0_Energy_0<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;color:black;mso-ligatures:none">14</span><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;mso-ligatures:none"><o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">CPU_0_Energy_0<o:p></o:p></span></p>
              </td>
            </tr>
            <tr style="height:15.75pt">
              <td style="border:solid #CCCCCC
                1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">20<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">GPU_0_DRAM_0_Power_0<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;color:black;mso-ligatures:none">15</span><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;mso-ligatures:none"><o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">GPU0DRAM0Power0<o:p></o:p></span></p>
              </td>
            </tr>
            <tr style="height:15.75pt">
              <td style="border:solid #CCCCCC
                1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">20<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">CPU_0_EDPViolation_0<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;color:black;mso-ligatures:none">15</span><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;mso-ligatures:none"><o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">CPU0EDPViolati0<o:p></o:p></span></p>
              </td>
            </tr>
            <tr style="height:15.75pt">
              <td style="border:solid #CCCCCC
                1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">26<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">ProcessorModule_0_Energy_0<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;color:black;mso-ligatures:none">15</span><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;mso-ligatures:none"><o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">ProcModu0Energ0<o:p></o:p></span></p>
              </td>
            </tr>
            <tr style="height:15.75pt">
              <td style="border:solid #CCCCCC
                1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">23<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">Baseboard_HSC_0_Power_0<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;color:black;mso-ligatures:none">15</span><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;mso-ligatures:none"><o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">BasebHSC0Power0<o:p></o:p></span></p>
              </td>
            </tr>
            <tr style="height:15.75pt">
              <td style="border:solid #CCCCCC
                1.0pt;border-top:none;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">50<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">ProcessorModule_0_MemCntl_0_PageRetirementCountl_0<o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;background:white;padding:1.5pt 2.25pt 1.5pt
                2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal" style="text-align:right" align="right"><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;color:black;mso-ligatures:none">15</span><span style="font-size:9.0pt;font-family:"Google Sans
                    Mono",serif;mso-ligatures:none"><o:p></o:p></span></p>
              </td>
              <td style="border-top:none;border-left:none;border-bottom:solid
                #CCCCCC 1.0pt;border-right:solid #CCCCCC
                1.0pt;padding:1.5pt 2.25pt 1.5pt 2.25pt;height:15.75pt" valign="bottom">
                <p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-ligatures:none">PM0MC0PaReCoun0<o:p></o:p></span></p>
              </td>
            </tr>
          </tbody>
        </table>
        <p class="MsoPlainText"><o:p> </o:p></p>
        <p class="MsoPlainText"><o:p> </o:p></p>
        <p class="MsoPlainText"><o:p> </o:p></p>
        <p class="MsoPlainText">Thanks <o:p></o:p></p>
        <p class="MsoPlainText">Rohit <o:p></o:p></p>
        <p class="MsoPlainText"><o:p> </o:p></p>
        <o:p></o:p>
      </div>
    </blockquote>
    <div class="moz-signature">-- <br>
      
      <title></title>
      <font color="#1F497D"><font face="Century Gothic">Johnathan Mantey<br>
          <small>Senior Software Engineer</small><br>
          <big><font color="#555555"><small><b>azad te</b><b>chnology
                  partners</b></small><br>
              <small><font color="#1F497D"><small>Contributing to
                    Technology Innovation since 1992</small></font><small><br>
                  <font color="#1F497D">Phone: (503) 712-6764<br>
                    Email: <a href="mailto:johnathanx.mantey@intel.com" class="moz-txt-link-freetext">johnathanx.mantey@intel.com</a></font></small><br>
                <br>
              </small></font></big></font></font> </div>
  </body>
</html>