Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRILL-4258: Add threads, fragments, and queries system tables #479

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

StevenMPhillips
Copy link
Contributor

Here are the pojos that represent the data for the new system tables:

  public static class FragmentInfo {
    public String hostname;
    public String queryId;
    public int majorFragmentId;
    public int minorFragmentId;
    public Long memoryUsage;
    /**
     * The maximum number of input records across all Operators in fragment
     */
    public Long rowsProcessed;
    public Timestamp startTime;
  }
  public static class ThreadSummary {
    /**
     * The Drillbit hostname
     */
    public String hostname;

    /**
     * The Drillbit user port
     */
    public long user_port;
    public String threadName;
    public long threadId;
    public boolean inNative;
    public boolean suspended;
    public String threadState;
    /**
     * Thread cpu time during last second. Between 0 and 100
     */
    public Integer cpuTime;
    /**
     * Thread user cpu time during last second. Between 0 and 100
     */
    public Integer userTime;
    public String stackTrace;
  }
  public static class QueryInfo {
    /**
     * The host where foreman is running
     */
    public String foreman;
    /**
     * User who submitted query
     */
    public String user;
    public String queryId;
    /**
     * Query sql string
     */
    public String query;
    public Timestamp startTime;
  }

I did not include data in the query table which can be obtained from the fragments table and doing a join on the queryId.

import java.util.Map.Entry;
import java.util.concurrent.ConcurrentLinkedDeque;

public class ThreadStatCollector implements Runnable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a thread (WorkManager.StatusThread) that does periodic tasks (currently updates fragment statuses), how about we add this as another task?

@cgivre cgivre added the revisit label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants