code: public EventServiceSegment getSegment(String service, boolean forceCreate) {
          EventServiceSegment segment = segments.get(service);
          if (segment == null && forceCreate) {
              // we can't make use of the ConcurrentUtil; we need to register the segment to the metricsRegistry in case of creation
              EventServiceSegment newSegment = new EventServiceSegment(service, nodeEngine.getService(service));
              EventServiceSegment existingSegment = segments.putIfAbsent(service, newSegment);
              if (existingSegment == null) {
                  segment = newSegment;
                  nodeEngine.getMetricsRegistry().scanAndRegister(newSegment, "event.[" + service + "]");
              } else {
                  segment = existingSegment;
              }
          }
          return segment;
      }
docs: Returns the {@link EventServiceSegment} for the {@code service}. If the segment is {@code null} and
  {@code forceCreate} is {@code true}, the segment is created and registered with the {@link MetricsRegistry}.
  
  @param service     the service of the segment
  @param forceCreate whether the segment should be created in case there is no segment
  @return the segment for the service or null if there is no segment and {@code forceCreate} is {@code false}