Benchmarking Apps created with feathers - benchmarking

Does anyone tried benchmarking / profiling an app created with feathersjs?

You can try feathers-profiler which logs service method calls (through any transport) and profile information. For gathering profiles the debugging documentation should also give you more information.
Besides that any standard webserver benchmarking tool will also work.

Related

using golang logging library, where does one see localhost logs?

following the golang library instructions if you write logs with the client library, where can one see those logs when running your server locally during development (eg via go run main.go)?
in my case (not sure if it's relevant) i'm using the library as part of golang logic in appengine, and even the relevant-looking instructions on "viewing logs" for those docs don't mention local development explicitly. Is that because it (running gcloud app logs tail and seeing local server logs) should "just work" or because there's no way to see logs for a local logs sdk interaction?
It's a good question and the Cloud Logging libraries do appear bound to Google's Cloud Logging service but, for local development (your question) and, loose-coupling as a generally good principle, these libraries really ought to be pluggable. Why shouldn't services running on e.g. GCP route logs to e.g. AWS?
With OpenTelemetry (nee OpenCensus), Google (and others) promote the ability to disconnect metric and trace production from consuming services, and logs aren't distinctly different.
A popular logging library in Go, Logrus supports pluggable logging via Hooks and an old (!) Stackdriver Logging implementation exists; this should be straightforward to upgrade to the current API (version).
Meantime, I think your question would benefit from being posted to Google's public issue tracker for Stackdriver (sic.) logging (link) and I'm going to ask someone who's very familiar with Cloud Logging as she may have some insight into this for us.
Update
I emailed with some former colleagues at Google and learned that Open Telemetry will eventually encompass logging. This is mentioned briefly on the project's About page.
tl;dr Tentatively answering myself: that's not supported - instead one has to just conditionally swap out calls to regular logger if env (eg empty GAE_INSTANCE env variable) indicates you're on localhost.
Walking through the code under the NewClient(...) call on the logging package, I end up a spot where the upstream API is really being called (note the rpc context used by the very last turtle - I never saw logic as I walked through that seemed to be switching to something for local development), so I suspect there really is no emulation capturing.
EDIT: See DazWilkin's helpful answer below for more context

Calling MS Dynamics CRM SOAP Service using Angular JS

I am developing an ionic application which will interact with MS Dynamics CRM. I have looked online for solutions, but all solutions are either RESTful implementations or non MS Dynamics implementations. Has anyone implemented SOAP services of MS Dynamics using Angular JS? If possible please share example.
Several questions that probably will lead you to solution:
Do you have special requirements to use SOAP? Most of CRM functionality successfully exposed via REST / OData endpoints. Only for really none-trivial cases you would need to use SOAP syntax. You can check list of current limitations here. Consider using REST instead.
Another question would be, where your application is deployed? Is it within CRM itself? Or not? If Angular application is started within CRM (as WebResource) this is a lot simpler! Since you are already authorized to the service and you don't need to bother about that. In this case maybe this library could provide you some help... there are several approaches to create great middleware for SOAP requests to CRM, this seems to be most modern one.
But if you're not authorized... This is whole new level of the problem... Which environment you're targeting? OnLine? OnPrem?
In that case, first you need to authorize, then you can proceed with your queries, for example with the help of the library on previous step. There is one JS library that could help. It is abandoned, but you can take a look on the code. I'm talking about dynamicscrm-api. It won't work in browser, but it will give you understanding, how you can move on.

How to interact with a locally running datastore service in appengine-magic?

I'm using appengine-magic to set up a web application, more or less as described at http://www.digitalbricklayers.com/2012/03/geotasklist-in-jquery-mobile-and.html. The example works on my local machine, locations and tasks are added to a local datastore etc.
My question is if it is possible to interact with the datastore from within a REPL, e.g. call (ds/save! ...) etc. during interactive development? I ask because when I try I get:
NullPointerException No API environment is registered for this thread.
com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId
(DatastoreApiHelper.java:108)
I'm getting this error no matter if I use an eclipse+counterclockwise based setup or an emacs+slime based setup.
Thanks,
Joachim
There's a bunch of ways to do this.
The easiest way is to go to the admin console (http://localhost:/_ah/admin) and click on the "Interactive Console".
I use django-nonrel, which comes with a command to launch an interactive shell (manage.py shell). If you're not using django-nonrel though, getting it set up though, is somewhat involved. I suspect most of what's necessary is found in the setup_env() function in django-nonrel: https://github.com/django-nonrel/djangoappengine/blob/develop/djangoappengine/boot.py
Getting it all to work is a pain, good luck.
The solution I use 99% of the time is to use pdb and force the interpreter to break at a certain point in my app where I need to do some debugging. See this for instructions: http://eatdev.tumblr.com/post/12076034867/using-pdb-on-app-engine
appengine-magic lets you use App Engine services (like the datastore) as long as the application is running; see https://github.com/gcv/appengine-magic#app-engine-services — as long as you ae/start your application, it should work.

custom authentication and authorization on GAE

im trying to understand how to implement my own authentication and authorization machinery for my GAE app. does anyone already implemented something like that and maybe can give me some advice?
what i need is grant access on certain sections to specific users and restrict the access to others.
i looked at repoze.who and reapoze.what but its not really clear to me how to use them on app engine.
thank you
Maybe taking a look at tipfy.ext.auth (doc, wiki, source code,) and tipfy.ext.acl (doc, wiki, source code) would provide you with a little kickstart. Those are extensions built on top of tipfy, a open source lightweight python-based framework made for GAE.
In order to get a better understanding of their usage and implementation, make sure to peek at the source code of each and the associated testsuites.
From your question it is not clear if you are using java or python. I have done my custom user management with authentication/authorization using spring-security in java GAE. Things work fine.
Here and here are some more info/links from me.

Why can't I use a UI component (Windows form) inside of a Windows service?

I've seen several posts that essentially state that UI components shouldn't run as a service. I understand the rational that no one can respond to UI events etc. But the fact remains that are are many automation tasks that are only possible with Windows forms.
Here is a couple of great examples:
I would like to build a url crawler
service that makes thumbnails of
webpages. Currently the only way I
see to achieve this is to try and
automate the .Net WebBroswer
component.
Automate the printing of MS-Word
docs.
Pre-Vista there was some tricks to get around this, but now there is none. My question is why is this the case, and what alternatives does one really have?
Lookup Shatter Attacks and Session 0 Isolation Feature.
Basically if two processes (of different users) share the same desktop, one process can potentially execute whatever code it wants in the other process by sending windows messages, and this was called a Shatter Attack.
There was a lot of discussion whether this was a design bug or not, and post Vista, Microsoft decided to remove any interactive desktop support for services as that was a potential security hole.
As an alternative, you can consider, running your image generation/printing code as a logged in user, who has access to an interactive desktop.
Like Moron said best thing to do is not run it as a service.
But perhaps you're stuck running it from a service anyway, because there is an existing framework of some sort that you're needing to run your code from.
So the workaround to that would be to write a server program that runs as a logged in user. You will hit that server program from your code the must be in a service. The server will do the work and return the results.
You can communicate between the 2 using WCF over named pipes as the transport, or whatever works. If that doesn't, you can use bare named pipes, or, tcp/ip on the localhost. Judging from your website in your userprofile, you should know all about localhost!
Technically, UI components requires started Windows Message Queue to work. You can run it from windows service (may be with allowed Interaction with Desktop, as far as I know this feature is disabled in Windows Vista and higher).
But things you are talking about is not UI components, it is COM components, and you can use it. At least MS Office, but it is not recommended by Microsoft, because memory leaks are possible. Latest MS Office has server edition, that can be used in application without user interface.

Resources