Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: GA has error 'timeout' for queries more than 60 seconds

  1. #1
    Join Date
    Sep 2014
    Posts
    175

    Default GA has error 'timeout' for queries more than 60 seconds

    Hello there ---

    The Google Analytics step, by default, times out after 60 seconds - at least in the Spoon version 5.4. Not sure if later versions are more robust.

    I think it is Google Analytics itself (not PDI) that has the timeout.

    Their forums recommends specific Java code to override the timeout - but I'm not sure how to implement this with the PDI step in particular. Would a Java step immediately prior to the GA step somehow work? I have my doubts, but perhaps -

    Anyone have a fix to this?

    The alternative is to change the query so it only takes very small date ranges (like 7 days) at a time.

  2. #2
    Join Date
    Sep 2014
    Posts
    175

    Default

    Here's specifically what Google says about Java timeout errors when calling the Google Analytics API below.

    I'm not sure how to implement this in PDI or if it's possible to using the Java code step.

    Couldn't the step be reworked to include a default upper limit of something like 10 minutes? 1 minute is anemic ...


    privateHttpRequestInitializer setHttpTimeout(finalHttpRequestInitializer requestInitializer){ return new HttpRequestInitializer() {
    @Override
    public void initialize(HttpRequest httpRequest) throws IOException {
    requestInitializer.initialize(httpRequest);
    httpRequest.setConnectTimeout(3 * 60000); // 3 minutes connect timeout
    httpRequest.setReadTimeout(3 * 60000); // 3 minutes read timeout
    }
    };

    GoogleCredential credential = ....

    finalAnalytics analytics =Analytics.builder(newNetHttpTransport(), jsonFactory, setHttpTimeout(credential)).build();

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.