w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Setting up Netflix Hystrix to use the metrics dashboard
There is a bug report potentially related to this at https://github.com/Netflix/Hystrix/issues/180 As for the documentation, have you looked at https://github.com/Netflix/Hystrix/wiki/Dashboard#installation-of-dashboard ?

Categories : Java

Why are my entities not showing up on devserver even though they are showing up on the dashboard?
Your query for getting user is wrong: This: u = db.GqlQuery("SELECT username FROM Users WHERE username='self.username'") should change to something like this: u = db.GqlQuery("SELECT username FROM Users WHERE username = :1", self.username) Take a look at the docs

Categories : Python

Run code once Spring app is succesfully deployed
You can use @PostConstruct annotation or a ApplicationListener that get triggered by the ContextStartedEvent (but take care if you have a typical web application you have two contexts and so two ContextStartedEvents.

Categories : Spring

Run Spring Jobs as jar module packaged in ear and deployed in Jboss
Have you looked at CommandLineJobRunner? Is this what you want? You might also have luck with the Spring Batch.

Categories : Spring

Spring Logs cannot be viewed in console or log file(Application deployed in WAS)
I believe you're just missing the configuration file parameter you need to set in JVM: Servers > Application servers > [app server name] > Process definition > Java Virtual Machine Than point Log4J configuration file: -Dlog4j.configuration=$POINT_TO_LOG4J_CONFIG_FILE

Categories : Apache

How to change the context path of a Spring MVC application deployed in TOMCAT 6.0
When adding a context.xml to the META-INF directory of the web application you should only need to specify the path, the other fields are deducted from where the application is deployed. The docBase is only needed if you specify the path inside the hosts or server.xml. <?xml version="1.0" encoding="UTF-8"?> <Context path="/DS" reloadable="true" /> So basically the above should be enough, make sure that you don't have any leftovers from your previous attempts as that might influence how this works. (Although I believe this one should take precedence over the others).

Categories : Maven

Spring can not load properties when webapp is deployed on Maven embedded Tomcat
/WEB-INF/conf is not in the CLASSPATH; /WEB-INF/classes is. Try putting your .properties file there and see if you do better. If that doesn't work, I'd wonder if it's a class loader hierarchy problem. Java EE containers have a hierarchy of class loaders: first is the bootstrap, second is the app server, last is the application. It might be that you have the .properties file in the application loader when it's needed at the app server level.

Categories : Maven

Spring Roo listing page not showing Foreign key but showing full dependent row
Given... // Spring Roo 1.2.4.BUILD-SNAPSHOT [rev 7c12381] log opened at 2013-06-15 17:13:26 project --topLevelPackage org.foo.bar --projectName baz jpa setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT entity jpa --class ~.db.Customer field string name entity jpa --class ~.db.Sale field string --fieldName description field number --type java.math.BigDecimal --fieldName amount field reference --fieldName customer --type ~.db.Customer --cardinality MANY_TO_ONE focus --class ~.db.Customer field set --fieldName sales --type ~.db.Sale --cardinality ONE_TO_MANY web mvc setup web mvc all --package ~.web quit When you show the list of Customers (one side) it shows just the customer data. For the sales (many) side, it shows the Customer column, with the field value of all fields c

Categories : Spring

Configure spring security ldap-server attribute to use different url based on deployed environment
I've done that with Spring profiles: In your spring.*.xml config file use this at the end of your file: <beans profile="production"> ... </beans> <beans profile="local"> ... </beans> As VM Arguments the used profile must be provided: -Dspring.profiles.active=production Regards

Categories : Spring

Is there a standard way to customize the deploy path in Spring Boot?
As it uses an embedded tomcat you should be able to add a /META-INF/context.xml to each application which specifies the path (at least this should work for a normal tomcat). That works for our normal embedded tomcat stuff, so I would expect it to work for Spring Boot as well.

Categories : Java

how to refactor a manually deployed single instance app into a client deployed multi-instance or multi-tenant app
I count 3 questions here, and you might find it valuable to split them into separate threads. At any rate: 1) What test to determine the correct architecture? Well, a hard-assed look at how much it's going to cost to support each architecture vs. how quickly each can be implemented & how many waiting customers you have seems in order. Hard-assed because, frankly, you probably already have a preference, and unless you're willing to set that aside the answer I give here is moot. If this is for a business, remember that revenue rules -- without revenue even the most beautiful & elegant architecture is unimportant. With revenue, you can fix most architecture mistakes in time. 2) What are good design patterns for multi-tenant, embed-able applications? I'm not sure that design pat

Categories : Javascript

Showing logged in state with spring and tiles
If you are using spring security (you tagged your question with spring) the spring security tag lib might be an option: <ul id="navigation"> <li> <a href="..">Everyone can see this link</a> </li> <sec:authorize access="hasRole('SomeRole')"> <li> <a href="..">Only users with role SomeRole can see this link</a> </li> </sec:authorize> </ul> For simple things like some additional buttons within the navigation this works fine. But be aware that this only toggles the visibility of the links in the view. You still have to protect your controllers/services to make sure only logged in users can access them.

Categories : Java

need spring security java config example showing basic auth only
UPDATE: This is fixed in Spring Security 3.2.0.RC1+ This is a bug in the Security Java Configuration that will be resolved for the next release. I have created SEC-2198 to track it. For now, a work around is to use something like the following: @Bean public BasicAuthenticationEntryPoint entryPoint() { BasicAuthenticationEntryPoint basicAuthEntryPoint = new BasicAuthenticationEntryPoint(); basicAuthEntryPoint.setRealmName("My Realm"); return basicAuthEntryPoint; } @Override protected void configure(HttpSecurity http) throws Exception { http .exceptionHandling() .authenticationEntryPoint(entryPoint()) .and() .authorizeUrls() .anyRequest().authenticated() .and() .httpBasic(); } PS: Thanks for

Categories : Spring

CloudWatch custom metrics using for what?
The idea of CloudWatch is to collect metrics from running cloud resources (servers, applications, databases, etc.) and share this information among other resources, in order to let them make decisions. For example, your application may produce the following metrics: size of in-memory queue memory available for JVM disk space available for cache users currently active transactions per minute $ sales per hour In an extreme case you can even reproduce Google Analytics with CloudWatch. It's a convenient instrument to collect statistics and distribute it.

Categories : Amazon

Code metrics in .NET application
Requirements may vary depending of the application role. MSDN gives you a general rule of thumb, for buisness or mission critical applications requirements can be higher. In general, client, the one who pays for development, knows best about the application role, so it is up to her to decide, whether it worth investing in mantainability or not. There is no certain answer, each case should be evaluated separately.

Categories : Misc

How do I get latest value for Cubism Metrics
I'm afraid this in on handler refers to something else. Use metric.valueAt(<your index>) instead, which will be 1079 (the last index of the metric data array, 1080 is the size of it).

Categories : Javascript

Do not draw empty metrics
I have finally resolved this issue by adding the feature "hideEmpty(true)" https://github.com/square/cubism/pull/56 d3.select("#graphs").call(function(div) { div.append("div").selectAll(".horizon") .data([metrics[i]]) .enter().append("div") .attr("class", "horizon") .style("font-size", "10px") .call(context.horizon() .hideEmpty(true) .title(metricName[metricName.length-1])); });

Categories : Javascript

Simulation Performance Metrics
I might not understand what you exactly want. But here is my suggestion. Let me know if my solution is inaccurate/irrelevant and I will edit/delete accordingly. Assume you have a certain metric (say compatibility of the pairs or waiting time). If you just have the average or total number for this metric over all the users, it is kind of useless. Instead you might want to find the distribution of of this metric over all users. If nothing, you should always keep track of the variance. Once you have the distribution, you can calculate a probability that particular algorithm A is better than B for a certain metric. If you do not have the distribution of the metric within an experiment, you can always run multiple experiments, and the number of experiments you need to run depends on the varia

Categories : Algorithm

OpenTSDB - Get all metrics via http
OK, api/suggest returns the list based on matching supplied parameter. This will get me out of trouble on this question, although it doesn't return all metrics it gives me a method to make it work. Example Request Query String http://localhost:4242/api/suggest?type=metrics&q=sys&max=10 JSON Content { "type":"metrics", "q":"sys", "max":10 } I hope this helps anyone else, basically RTFM! (http://opentsdb.net/docs/build/html/api_http/suggest.html)

Categories : C#

Understanding Rails runtime metrics
What you're showing is that over 2/3 of your request processing time isn't included in the model/view. What's left? Other code running within your controller and request processing life-cycle. The best way to profile this is to install the newrelic RPM gem and run the local profiler: Add the gem to your Gemfile: gem 'newrelic_rpm' Enable local profiling in development for config/newrelic.yml: development: <<: *default_settings monitor_mode: false developer_mode: true Execute your request 2-3 times to warm up your Rails app and then visit the local newrelic app to view the traces and track down what's happening: http://localhost:3000/newrelic

Categories : Ruby On Rails

Google analytics- differences in Metrics
There is ample documentation on this already... a google would have given you: https://developers.google.com/analytics/devguides/reporting/core/dimsmets#cats=visitor

Categories : Google Analytics

Cant figure out how to put Program Metrics in MSAccess
Ugh..finally figured it out. I shouldn't have been trying to recalculate the sum. Instead I used the query SELECT tblProjects.ProjectName, qryLinesOfCode.LinesOfCode AS LinesOfCode, Round(Avg(tblComplexity.CyclomaticComplexity)+StDevP(tblComplexity.CyclomaticComplexity),2) AS MaxDeviation, Max(tblComplexity.CyclomaticComplexity) AS MaxOfCyclomaticComplexity, Min(tblComplexity.CyclomaticComplexity) AS MinOfCyclomaticComplexity, Round(Avg(tblComplexity.CyclomaticComplexity)-StDevP(tblComplexity.CyclomaticComplexity),2) AS MinDeviation FROM (tblProjects INNER JOIN tblComplexity ON tblProjects.ID = tblComplexity.RunID ) INNER JOIN qryLinesOfCode ON tblProjects.ProjectName = qryLinesOfCode.ProjectName GROUP BY tblProjects.ProjectName, LinesOfCode;

Categories : SQL

Enable CPU Monitoring Metrics in Azure
I would recommend you to watch the "Monitoring, Management & DevOps in Windows Azure" https://channel9.msdn.com/(A(-6U-pJH5zAEkAAAANmJlY2IzMGItZWMzNS00MWU0LWIxNmEtNTNkMDMxZDBmYjgyubegdSHFWEu7r941495i4kaqXyQ1))/Events/Build/2013/3-558

Categories : Azure

Price for CloudWatch custom metrics
Its $0.50 per month per metric. I don't think you have the choice of detailed or not with custom metrics. That is only applicable to basic EC2 metrics. Current prices are available at the Amazon Cloudwatch website.

Categories : Amazon

What are the most important metrics when monitoring openDJ?
With OpenDJ, all metrics are equally available through LDAP and JMX. SNMP only has a subset of the metrics, i.e. the ones that are defined in the standard directory MIB. When monitoring any server, I don't think a single capture of metrics is useful. What you want to compute average and running average over sample periods, define thresholds for some of the metrics and raise alert when those thresholds are met.

Categories : Misc

Python: Calculate metrics from list of APIs
How about something like this: def aggregate(stats): aggregated = {} for stat in stats: key = stat.pop(0) stat = map(float, stat) if key not in aggregated: vals = {"avg": []} aggregated[key] = vals aggregated[key]['min'] = min(stat[0], aggregated[key].setdefault('min', stat[0])) aggregated[key]['max'] = max(stat[1], aggregated[key].setdefault('max', stat[1])) aggregated[key]['avg'].append(stat[2]) return aggregated def print_stats(aggregated): for k, v in aggregated.items(): print k, for k1, v1 in v.items(): if k1 == 'avg': print "%s: %s" % (k1, sum(v1) / len(v1)), else: print "%s: %s" % (k1, v1), print stats = [

Categories : Python

Why Don't the Azure Storage Capacity Metrics Show a Value?
Okay, so this is working as of the next day. I had to change the view to 24 hours from the default last 6 hours to get anything to show. Maybe this will help someone if they have the same issue.

Categories : Azure

Distinct metrics for Cubism (Square/Cube)
Cube objects are stored as objects / dictionaries in MongoDB, so it's definitely possible to access their data property. The required data is in a database called cube_development. Play around with it a bit to get a feel for the data, and then use the MongoDB C# driver to access the data. Hope this helps!

Categories : C#

Calculate time based metrics(hourly)
Given your posted input file: $ cat file 2013-04-03 08:54:19,989 INFO [LOGGER] <?xml version="1.0" encoding="UTF-8" standalone="yes"?><event><body>&amp;lt;UId&amp;gt;904c-be-4e-bbda-3e62&amp;lt;/UId&amp;gt;&amp;lt;</body></event> 2013-04-03 08:54:39,389 INFO [LOGGER] <?xml version="1.0" encoding="UTF-8" standalone="yes"?><event><body>&amp;lt;UId&amp;gt;904c-be-4e-bbda-3e62&amp;lt;/UId&amp;gt;&amp;lt;</body></event> 2013-04-03 08:54:34,979 INFO [LOGGER] <?xml version="1.0" encoding="UTF-8" standalone="yes"?><event><body>&amp;lt;UId&amp;gt;edfc-fr-5e-bced-3443&amp;lt;/UId&amp;gt;&amp;lt;</body></event> 2013-04-03 08:55:19,569 INFO [LOGGER] <

Categories : Bash

Keeping count of user metrics based around time
You will need to track all data that is (even partially) required to get the achievement. For the achievements around logging in, you need to track each login once per day, having a table like: user_id | login 1 | 2013-07-20 1 | 2013-07-19 1 | 2013-07-16 2 | 2013-07-20 ... Whenever the tracking event is triggered, you also check for the achievements. event onLogin { // get the last 4 logins before the current login statement = ( SELECT login FROM tracking_user_login WHERE user_id = 1 ORDER BY login DESC LIMIT 1,4 ); statement.execute(); // did the user even login at least 4 times already? if (statement.rowCount == 4) { date lastLogin = todaysLogin; int consecutiveLogins = 1; // iterate descending thro

Categories : Database

trying to write code to check source of webpage for certain metrics
There are web site parsing libraries out there. I used JSoup (at http://jsoup.org/) for Java to parse the IBM information center and was successful. There are examples for table parsing everywhere, like at how to parse a table from HTML using jsoup. Since the question is about parsing HTML in PHP: I personally never used such a PHP library. However How do you parse and process HTML/XML in PHP? may help.

Categories : HTML

Cloud watch custom metrics creation with java possible or not?
Yep, it's absolutely possible to create custom metrics programmatically using the AWS SDK. Here's a link to the CloudWatch client as part of the AWS SDK for Java: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/cloudwatch/AmazonCloudWatchClient.html If I remember correctly, you just start putting data into CloudWatch using the putMetricData(..) method, and it will start showing up (after a short delay of a minute or two).

Categories : Java

How to get metrics and dimensions list using Google Analytics API functions in php?
This is not available through the API. the full list of dimensions and metrics is available at the developer.google.com/analytics site: https://developers.google.com/analytics/devguides/reporting/core/dimsmets

Categories : PHP

new relic sqlserver plugin failing to report metrics
While most New Relic Platform plugins are supported by the plugin author, this particular plugin is supported by New Relic. Please follow up with our support team so we can help you achieve a resolution. You can reach New Relic support here: http://support.newrelic.com/

Categories : Sql Server

Can Cube (js metrics framework) return more than 1000 events?
Looks like there is a hard cap on results in three places that need to be updated for large domains: event.js - line 166 metric.js - line 11 metric.js - line 12 In addition, I was unable to find any query-string apis for the parameters. Ideally, we can leave the cap at 1000 (to avoid server bloat for people not tuning their queries correctly) and allow the consumer to define override behavior.

Categories : Misc

Android: Progamatically Calculate Listview Font Metrics
You need to specify that in the XML of your list item row file. These are the attributes you need to play with on your TextView; android:singleLine="true" android:maxLength="someLengthofCharacters(int)" android:ellipsize="end" //if you want an ellipse to be appended to the end of your String EDIT: Try this approach to set the max character length of your TextView programmatically TextView tv = new TextView(this); int maxLength = 10; InputFilter[] fArray = new InputFilter[1]; fArray[0] = new InputFilter.LengthFilter(maxLength); tv.setFilters(fArray) and set single line to true by using TextView.setSingleLine or TextView.setLines(1)

Categories : Android

Eclipse Graphical Layout Window Metrics returns NullPointerException
I think you should be using getContext().getResources().getDisplayMetrics(). Getting it from the window manager might be a little too "low-level" for eclipse to deal with nicely. I would also suggest that you use the measure specs rather than the displaymetrics unless you have permission to draw outside of your view/activity bounds, the actual space you are trying to fit in is always passed into onMeasure WidthSpec/HeightSpec..

Categories : Android

What tool can help me identify various performance metrics pertaining to a server & also monitor them?
A tool will not solve your issues. As to being a performance tester or a performance engineer the tool is 5-12% of the job. The rest of the job is interwoven with your foundation skills in communications, development, architecture, project management, systems analysis, etc... What you have expressed here would speak to weaknesses in application architecture and systems analysis. You need to understand what to monitor to discover system bottlenecks before you can ask a tool to monitor this information on your behalf. I would turn you to several references by Andrew Tanenbaum, "Modern Operating Systems" and "Distributed Systems: Principles and Paradigms." Keep in mind that JAVA Virtual Machines, .Net Virtual Machines and Databases function as guest operating systems so the princip

Categories : Performance

Enforce QoS metrics on Java methods via timeouts in Jersey server
The way to do this would be to implement a servlet filter. A basic filter looks like this: public class TimeoutFilter implements Filter { @Override public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain chain) throws IOException, ServletException { final HttpServletRequest req = (HttpServletRequest)servletRequest; try { // Execute this with a time limit chain.doFilter(servletRequest, servletResponse); } catch (Exception e) { // Handle exceptions here; you should state the exceptions explicitly // rather than just catching Exception } } } You can then set up an Executor or whatever in the filter to provide a time limit for the requ

Categories : Java

Google analytics - How to send values for custom dimension/metrics
Finally worked!! Apparently you must wait a time (like 2 days for me) before Google starts to record the information. Documentation not specified this detail. I hope this answer helps other people with the same question!!

Categories : Google Analytics



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.