chromium/ui/latency/latency_info.dot

// dot -Tpdf ui/latency/latency_info.dot > latency_info.pdf

digraph LatencyInfo {
  node[shape=box];

  // Set shape and label of metric names.
  {
    node[style="dotted,rounded"];

    scroll_to_schedule_metrics
      [label="\
UKM: Event.<scroll_name>.<input_modality>.TimeToHandled\n"];
    scroll_to_gpu_swap_metrics
      [label="\
UKM: Event.<scroll_name>.<input_modality>.TimeToScrollUpdateSwapBegin\n"]
  }

  // Set labels for nodes with multiple components.
  scroll_original
    [label="\
INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT\n\
INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT"];
  rendering_scheduled
    [label="\
INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT\n\
INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT"];

  // Layout "original" components at the top.
  {
    rank=same;
    edge[style=dotted,minlen=4];
    INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT->
    scroll_original;
  }

  // Layout the rest of the components.
  INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT->
  end_to_end_metrics->
  INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT;

  scroll_original->
  scroll_to_schedule_metrics->
  rendering_scheduled->
  INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT->
  INPUT_EVENT_LATENCY_FRAME_SWAP_COMPONENT
    [weight=4];

  scroll_original->
  scroll_to_gpu_swap_metrics->
  INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT;

  // Add legend and position it under INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT.
  legend
    [shape=plaintext,label="\
LEGEND:\l\
  <default_action_status> = (DefaultPrevented | DefaultAllowed)\l\
  <input_modality> = (Wheel | Touch)\l\
  <scroll_name> = (ScrollBegin | ScrollUpdate)\l\
  <thread_name> = (Main | Impl)\l"];
  INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT->
  legend
    [style=invis,minlen=10];
}