Titan IdGraph get Edge by Id slow - titan

I setup a Titan 0.5.2 Graph with DynamoDB as the backend. And I configured the Graph to be wrapped in an IdGraph. When I try to get an edge using our custom id from the IdGraph it takes about a minute, but when I try to get the edge using the default id from the regular Graph it takes less than a second.
graph.getEdge("id") // less than second
idGraph.getEdge("customId") // over a minute
What could be leading to this difference?

Related

Extract significant near future local events exact location and time using Facebook Graph Search api

I am looking for a way to extract significant (number of attendees > threshold) near future (within the next week) local events exact location and time using Facebook Graph Search api.
If local cannot be done, i could just specify a city (Athens, GR for example) instead.
It would be absolutely great if the info could be extracted with one query, but i think this is too much to hope for.
What i have tried so far is:
search?fields=location,events,name&limit=300&q=athens&type=place
This produces a set of events with name relative to "athens" as well as exact location, but not the time or number of attendees or event name.
{event_ID}?fields=attending.limit(1).summary(true)
This produces the number of attendees for a specific event_ID.
The total number of significant (let's assume more than 300 attendees) event for a week's span in Athens, GR should not be very high, therefore i could manually query the API as a last resort solution.
Does anyone have any idea if/how what i am asking can be achieved?
Thank you very much in advance.
You can't do this just in one query although you can probably batch some requests (https://developers.facebook.com/docs/graph-api/making-multiple-requests).
What I would do is:
Geo query to place: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.3#search
GET graph.facebook.com
/search?
q=coffee&
type=place&
center=37.76,-122.427&
distance=1000
Get the page_id and query for public events (batch): https://developers.facebook.com/docs/graph-api/reference/page/events
Get attendants for those events (batch): https://developers.facebook.com/docs/graph-api/reference/v2.3/event/attending
I hope it helps.

Google Analytics API TotalEvents query

I'm trying to get a total count for a give event,however I get a number much bigger(10-20 times bigger), than I see on the GA website, what am I doing wrong? (api v3)
here is the segment
metric:
ga:totalEvents
segment:
dynamic::ga:eventCategory==mycategory;ga:eventAction==myaction;ga:eventLabel==mylabel
note that I get wrong results with the query explorer as well.
You are using a segment instead of a filter.
Segments are session based so it will include all events in a session if it matches you specification. So essentially if I triggered the event you want plus other events they will all be included in the total events field.
What you need to do Is remove the segment and add a filter, the filter will include only the data you request.
Hope that helps

Getting all events given a certain filter criteria on Facebook

I'm trying to get events in Facebook that have a certain phrase or description in them. I'd like to not have the results filtered or limited, as the phrase is fairly specific.
As an example, the phrase I'm looking for is "UMvC3" (short for Ultimate Marvel vs. Capcom 3).
That said, I could run an FQL query (and subsequently enrich with a call to the Graph API, like so):
select eid from event where contains("umvc3") and start_time >= now()
order by update_time desc
This will give me upcoming events with "umvc3" in them as well as only ones occurring in the future (I'm not concerned with past events).
However, the selection is severely limited. For example, the following isn't returned in the search results:
https://www.facebook.com/events/595137740538545/
It clearly has "umvc3" in the description text.
I can perform a search using the Graph API, but that doesn't return the above result either. Additionally, I can't filter using the Graph API on the start_time or order the results in a manner where I can stop processing the result set once I get to a certain point.
Finally, there is the Public Feed API, which will give me the entire firehose (which isn't filterable, like Twitter's, unfortunately), so I'll have to filter in real-time, which could be near impossible.
That said, am I approaching this the wrong way, or is there no way to really get a comprehensive, exact set of results from the Facebook API for events?
Note: I'm using the access_token provided by the Graph Explorer in the tools section.
The description column of Event FQL table isn't indexable, thus the freestyle search on not indexable columns won't give any result.
The results you see by running the query you suggested gives only events where the 'umvc3' is in the name column, which is indexable.
The only option is to ask facebook for fulltext indexing this column which apparently won't happen. They surely won't open any column for using clause like 'LIKE' since the query execution will take a lot of time.
And the answer from Facebook developer: https://stackoverflow.com/a/5824449/334522

New Relic RESTful API: Returning aggregate data for the entire site in a custom time series

I have this API call to return aggregate day for my entire site, but the begin data and end date for wha the call uses do no seem to be configurable. Is there any way to configur a begin date and end date for this API call? Are there any custom attributes or parameters I can use?
https://api.newrelic.com/api/v1/accounts/:account_id/applications/:app_id/threshold_values.xml
The threshold_values API call returns information similar the information you see in your application list including the health status color for each listed application.
There is a small difference in that the API call reflects data aggregated over three minutes whereas the application list values are aggregated over five minutes. The time frame for this API call is not configurable.
The possible values of the health status are as follows:
1 = green
2 = yellow
3 = red poor performance
4 = red application down (ping failures)
Most other New Relic API calls can include a begin and end time.
Here's an example from the New Relic docs:
curl -gH "x-api-key:REPLACE_WITH_YOUR_API_KEY"
'https://api.newrelic.com/api/v1/accounts/REPLACE_WITH_YOUR_ACCOUNT_ID/applications/REPLACE_WITH_YOUR_APP_ID/data.xml?metrics[]=EndUser/Apdex&field=score&summary=1&begin=2011-12-15T00:00:00Z&end=2011-12-16T00:00:00Z'
Here begin=2011-12-15T00:00:00Z&end=2011-12-16T00:00:00Z represent the beginning and ending times in XML timestamp format with timezone.

Do Facebook Graph API calls using field expansion count differently against the rate limits than batch calls

I am looking to optimize my Facebook app.
Today I make a batch call with four graph API calls:
/me
/me/friends
/me/likes
/me/feed
If I change this to a single graph API call using field expansion like this:
/me?fields=id,name,username,friends,likes,feed
Will that now count as one hit against the API instead of four for rate limiting purposes?
Unfortunately, each call in the batch is counted as an api call, it's just faster to call them within a batch since it will be 1 request. See here documentation on Facebook API:
Limits
We currently limit the number of requests which can be in a batch to 50, but each call within the batch is counted separately for the purposes of calculating API call limits and resource limits. For example, a batch of 10 API calls will count as 10 calls and each call within the batch contributes to CPU resource limits in the same manner.
Source:
https://developers.facebook.com/docs/reference/api/batch/
Based on real-world testing, I've found that field expansion can count for multiple uses under the rate limit. For example, starting from a quiet state, a sequence of 63 field-expanded calls to a single api (graph.facebook.com/IDENTITY/posts) brought us to the 600 call rate limit.
According to the Facebook Docs,
The Field Expansion feature of the Graph API, allows you to effectively "join" multiple graph queries into a single call.
So your queries above would represent four calls in the Batch form, and one call in the Field Expanded form.
As I noted in a comment above: A batch sends multiple-but-not-necessarily-related queries to Facebook in a single request. Field expansion is like doing joins in SQL through a single query.