original_docstring: 
      Returns device readouts in OpenMetrics format
      
docstring: Returns device readouts in OpenMetrics format
docstring_tokens: Returns device readouts in OpenMetrics format
code: async def metrics(request):
      """
      Returns device readouts in OpenMetrics format
      """
      oma = OpenMetricsAggregator()
      tasks = [d.asyncWaitForNotifications(5) for d in GlobalConfig.connected_devices()]
      results = await asyncio.gather(*tasks)
      for success, device in results:
          if success:
              oma.add_metrics(device.open_metrics)
  
      return PlainTextResponse(oma.text)
code_tokens: async def metrics ( request ) : oma = OpenMetricsAggregator ( ) tasks = [ d . asyncWaitForNotifications ( 5 ) for d in GlobalConfig . connected_devices ( ) ] results = await asyncio . gather ( * tasks ) for success , device in results : if success : oma . add_metrics ( device . open_metrics ) return PlainTextResponse ( oma . text )
short_docstring: Returns device readouts in OpenMetrics format
short_docstring_tokens: Returns device readouts in OpenMetrics format
comment: """
      Returns device readouts in OpenMetrics format
      """