Thank you for posting some of your sample code here for your chat project. Without having the complete picture, I have assume the following about the contents and behavior of your application:
- *chat.html* is the chat application's front-end for the user to interact with other users - The front end checks for chat updates every 3 seconds presumably by refreshing the page (essentially issuing an HTTP GET requests to a given URL), or by using Javascript's XMLHttpRequest <https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest> towards said URL. - The code snippet above resides in the App Engine HttpServlet responding so above-mentioned URLs. - The application does not store any data elsewhere, or make any URL requests and simply responses to requests sent to it. Assuming the above, the 'Requests <https://cloud.google.com/appengine/docs/quotas#Requests>' quota section and 'Instance hours <https://cloud.google.com/appengine/docs/quotas#Instances>' quota section should help in identifying the quotas your application will encounter. Instance hours accumulate during application operation as described in said article. Regarding requests, usage is accrued based on the quantity of data transferred, not how many requests are in fact made. Therefore, every request sent to the application counts as towards 'Inbound Bandwidth'. Every response counts towards 'Outbound Bandwidth' regardless of the content. Note that printing an empty string to the HttpServletResponse only sets the message body to a zero-length string. The message will still contain all the expected HTTP headers <https://cloud.google.com/appengine/docs/java/requests#Java_Responses> and be sent in response by the application. I hope this answers your questions. On Monday, January 18, 2016 at 8:22:50 AM UTC-5, Hung Ha wrote: > > I am building a Java chat app based on App Engine platform. The app will > not store data into database but in a public static variable. > > Ok, Now, here is the logic > > A user can enter chat.html & post messages to server and the messages > will be stored inside a ConcurrentHashMap<User, List<String> > > Then chat.html will have a checkLatestMsg() function that runs every 3 > secs. Thus function will read the ConcurrentHashMap<User, List<String> & > > for(String s: list){ > if(s!=null && "".equals(s)){ > resp.setContentType("text/plain;charset=utf-8"); > resp.getWriter().println(s); > } > } > > So the resp.getWriter().println(s); won't show anything the list has no > data. My question is that: > > *Will Google count the number of call requests?* > > *What if we send a request but resp.getWriter().println(s); shows nothing, > then will Google count that call?* > > The Quota pages tell nothing about this: > https://cloud.google.com/appengine/docs/quotas > > *Could you clarify it?* > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/98e10a08-4677-4260-bebc-f1d8b6b44187%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
