Forum Discussion

rdaviscc's avatar
rdaviscc
Helper
13 years ago

Difference in Metrics

Hey All,

 

I have an odd question.  I am making a metrics dashboard for our community and I am noticing that the metrics from the administration area are not aligning with that of the API. 

 

For instance from January 1st to March 31st.

 

Category Admin pulls:

Overall Topics: 609

Forum Replies: 1276

 

API pulls:

Overall Topics: 618

Forum Replies: 1480

 

The differences go in a few different places and the code I am using is:

	public static String getTotalThreads(String sessionkey, String id, 
			String startDate, String endDate) {

		String metric = UserUtility.parseUserMetricXML(HTTPUtility
				.makeRequest( "/categories/id/" + id +"/metrics/name/threads"
						+ "?restapi.session_key=" + sessionkey + "&date_start="
						+ startDate + "&date_end=" + endDate));

		return metric;
	}

 and

	public static String getTotalReplies(String sessionkey, String id, 
			String startDate, String endDate) {

		String metric = UserUtility.parseUserMetricXML(HTTPUtility
				.makeRequest( "/categories/id/" + id +"/metrics/name/replies"
						+ "?restapi.session_key=" + sessionkey + "&date_start="
						+ startDate + "&date_end=" + endDate));

		return metric;
	}

 the base uri where I am doing the GET to is http://community.domain.com/restapi/vc

 

Please let me know what I can do or atleast give me an explanation of why the metrics are different.

 

Thank You in advance.


Ryan

 

1 Reply

  • LindsayM's avatar
    LindsayM
    Lithium Alumni (Retired)
    13 years ago

    Hi Ryan,

     

    Our lead developer hunted down the REST API calls you referenced. Here's his suggestions. Please let me know if this resolves your issue.

     

    Thanks!

     

    Lindsay McMahon

     

    1. It appears the request is for the metric named "threads"; however, I think "overall_threads" is what you are looking for.

    2. The end date in the REST API call is 4-19-2012. I believe it was intended to be 3-31-12.

    3. Our REST API is based on the UTC timezone wherease your admin metrics are based on ETC.  This should only result in a minor discrepancy. If you would like to account for the timezone difference, the API range is inclusive to exclusive (by hour). We use ISO 8601 for encoding dates and times, although you have to manually account for daylight savings.