Dataset Run Time

c7dev
c7dev Member
edited March 2023 in Datasets

I was trying to figure out if there's a way to track total dataset run time.

 

I'm just not sure where to find how long it took my dataset's to run from start to finish.

 

Thanks in advance for any help.

Best Answer

  • NewsomSolutions
    NewsomSolutions Domo Employee
    Answer ✓

    Both Dataset and Dataflows have a History tab at the top when you are in it for properties...it should show you run times there.

     

    Matt

     

    *Please Like to Thank

Answers

  • NewsomSolutions
    NewsomSolutions Domo Employee
    Answer ✓

    Both Dataset and Dataflows have a History tab at the top when you are in it for properties...it should show you run times there.

     

    Matt

     

    *Please Like to Thank

  • WHM
    WHM Contributor

    I wrote a C# program a long time ago that exports the dataset metadata and then pushes it back into Domo. I would recomend using hte something like powershell and the APIs to do the same thing. This allows me to create a card on the inputs datasets for a given dataflow - take sales for example - and with some beast modes I check if a given dataset updated before or after the dataflow kicked off. the card is color coded for "all good" or "Houston we have a problem". 

     

    Looking through the APIs I do not find anything for Dataflows. You might have to use C#. That makes it a bit trickier ...For what it is worth, here is the section of code I use to read the data about our dataflows

     

    Utility.LogMessage(DateTime.Now + " Creating array of dataflows to load back to Domo.");
    var dflows = client.DataFlows.GetDataFlowsAsync();
    DomoApi.Model.DataFlow.DataFlowCollection Dataflows = new DomoApi.Model.DataFlow.DataFlowCollection();
    Dataflows = await dflows;
    try
    {

    okToUpdate = true;

    foreach (var df in from DFList in Dataflows.DataFlows select DFList)
    {


    Console.WriteLine(df.Name);
    if (df.Inputs != null)
    {
    foreach (var inp in from inputlist in df.Inputs select inputlist)
    {
    if (df.Outputs != null)
    {
    foreach (var outp in from outputlist in df.Outputs select outputlist)
    {
    List<object> dfobj = new List<object>();

    if (df.Name != null) dfobj.Add(df.Name.ToString()); else dfobj.Add("no name");
    dfobj.Add(df.Id.ToString());
    if (df.DatabaseType != null) dfobj.Add(df.DatabaseType.ToString()); else dfobj.Add("no Database type");
    if (df.Description != null) dfobj.Add(df.Description.ToString()); else dfobj.Add("no Description");
    dfobj.Add(df.DocumentVersion.ToString());
    dfobj.Add(df.Enabled.ToString());

    dfobj.Add(df.LastExecution.LastUpdatedTimeUtc.ToString("o"));
    dfobj.Add(df.LastExecution.BeginTimeUtc.ToString("o"));
    dfobj.Add(df.LastExecution.EndTimeUtc.ToString("o"));

    dfobj.Add(df.ResponsibleUserId.ToString());

    if (inp.DataSetName != null) dfobj.Add(inp.DataSetName.ToString()); else dfobj.Add("no input dataset name");
    if (inp.DataSetId != null) dfobj.Add(inp.DataSetId.ToString()); else dfobj.Add("no Input Dataset Id");
    if (inp.ExecuteFlowWhenUpdated != null) dfobj.Add(inp.ExecuteFlowWhenUpdated.ToString()); else dfobj.Add("no dataflow trigger indicator");

    if (outp.DataSetName != null) dfobj.Add(outp.DataSetName.ToString()); else dfobj.Add("no Output Dataset Name");
    if (outp.DataSetId != null) dfobj.Add(outp.DataSetId.ToString()); else dfobj.Add("no Output Dataset Id");
    if (outp.DataFlowId != null) dfobj.Add(outp.DataFlowId.ToString()); else dfobj.Add("no Output Dataflow Id");
    dfobjects.Add(dfobj);
    dfobj = null;
    }

    }
    }


    }

    } // end of dataflow loop