Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package com.facebook.presto.execution;
 
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 
 public class SqlTaskManagerStats
 {
     private final CounterStat scheduledSplits = new CounterStat();
     private final CounterStat startedSplits = new CounterStat();
     private final CounterStat completedSplits = new CounterStat();
 
     private final CounterStat completedPositions = new CounterStat();
     private final CounterStat completedBytes = new CounterStat();
 
     private final CounterStat splitWallTime = new CounterStat();
     private final CounterStat splitCpuTime = new CounterStat();
 
     private final TimeStat splitQueuedTime = new TimeStat();
 
     private final TimeStat timeToFirstByte = new TimeStat();
     private final TimeStat timeToLastByte = new TimeStat();
 
     @Managed
     @Nested
     public CounterStat getScheduledSplits()
     {
         return ;
     }
 
     @Managed
     @Nested
     public CounterStat getStartedSplits()
     {
         return ;
     }
 
     @Managed
     @Nested
     public CounterStat getCompletedSplits()
     {
         return ;
     }
 
     @Managed
     @Nested
     {
         return ;
     }
 
     @Managed
     @Nested
     public CounterStat getCompletedBytes()
     {
         return ;
     }
 
     @Managed
     @Nested
     public CounterStat getSplitWallTime()
     {
         return ;
     }
 
     @Managed
     @Nested
     public CounterStat getSplitCpuTime()
     {
         return ;
     }
 
     @Managed
     @Nested
     public TimeStat getTimeToFirstByte()
     {
         return ;
     }
 
     @Managed
     @Nested
    public TimeStat getSplitQueuedTime()
    {
        return ;
    }
    @Managed
    @Nested
    public TimeStat getTimeToLastByte()
    {
        return ;
    }
    @Managed
    public long getRunningSplits()
    {
        return Math.max(0, .getTotalCount() - .getTotalCount());
    }
    public void addSplits(int count)
    {
        .update(count);
    }
    public void splitStarted()
    {
        .update(1);
    }
    public void splitCompleted()
    {
        .update(1);
    }
    public void addSplitCpuTime(Duration duration)
    {
        .update(duration.toMillis());
    }
    public void addSplitWallTime(Duration duration)
    {
        .update(duration.toMillis());
    }
    public void addCompletedPositions(long positions)
    {
        .update(positions);
    }
    public void addCompletedDataSize(DataSize addedDataSize)
    {
        .update(addedDataSize.toBytes());
    }
    public void addSplitQueuedTime(Duration duration)
    {
        .add(duration);
    }
    public void addTimeToFirstByte(Duration duration)
    {
        .add(duration);
    }
    public void addTimeToLastByte(Duration duration)
    {
        .add(duration);
    }
New to GrepCode? Check out our FAQ X