import glob


def count(grp, dirFiles, metric):
    """
    Function to count the number of *hdf5 files in a directory

    Parameters
    ---------------
    grp: pandas df row
    dirFiles: str
      main location dir of the files
    metric: str
      name of the corresponding metric

    Returns
    -----------
    number of corresponding files

    """
    fi = glob.glob('{}/{}/{}/*.hdf5'.format(dirFiles, grp['dbName'], metric))
    return len(fi)