Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4099

Replace XML statistics with Lua

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2.0
    • Component/s: Lua, Manager, Metrics
    • Labels:
      None

      Description

      The custom metrics XML format is undocumented and difficult to use and extend. Since we plan to use Lua for configuration programmability, lets make a start by replacing this subsystem with Lua.

      It turns out that Lua is mostly more readable and easier to understand. Performance is roughly similar.

      Example syntax:

      float 'proxy.node.user_agent_total_bytes_avg_10s' [[
        local self = ...
      
        return interval_delta_of_10s(self, function()
          return proxy.node.user_agent_total_bytes
        end)
      ]]
      
      counter 'proxy.node.origin_server_total_bytes' [[
        return proxy.node.http.origin_server_total_request_bytes +
          proxy.node.http.origin_server_total_response_bytes +
          proxy.node.http.parent_proxy_total_request_bytes +
          proxy.node.http.parent_proxy_total_response_bytes
      ]]
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jamespeach James Peach
                Reporter:
                jamespeach James Peach
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: