Display PDF and Abstract view number

well, I can’t upgrade the system now, may be after another month, in meanwhile, I was digging regarding PDF and ABSTRACT counter views, I could implement the following code in templates/frontend/objects/article_summary.tpl:

{translate key=“article.abstract”} viewed = {$article->getViews()} times

{if is_a($article, ‘PublishedArticle’)}{assign var=galleys value=$article->getGalleys()}{/if} |
{if $galleys}
{foreach from=$galleys item=galley name=galleyList}
{$galley->getGalleyLabel()} downloaded = {$galley->getViews()} times
{/foreach}
{/if}

as well I had to change the function getviews() in classes/article/ArticleGalley.inc.php to:
function getViews() {
$application = PKPApplication::getApplication();
$fileId = $this->getFileId();
if ($fileId) {
return $application->getPrimaryMetricByAssoc(ASSOC_TYPE_SUBMISSION_FILE, $fileId);
} else {
return 0;
}
}

I have result such : Abstract viewed = 17 times | PDF downloaded = 137 times

by logic, the Abstract views must be bigger then PDF views right? all my result are like that,
So, is there SQL query to run to get the result of specific paper with the metrics?

Also, I could not find any documentation about metrics tables and variables meaning ? such : ASSOC_TYPE_SUBMISSION_FILE , ASSOC_Type and the numbers, ASSOC_id, which field represent the specific article and so on?