w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Spark Standalone Mode: How to compress spark output written to HDFS
The method saveAsTextFile takes an additional optional parameter of the codec class to use. So for your example it should be something like this to use gzip: someMap.saveAsTextFile("hdfs://HOST:PORT/out", classOf[GzipCodec]) UPDATE Since you're using 0.7.2 you might be able to port the compression code via configuration options that you set at startup. I'm not sure if this will work exactly, but you need to go from this: conf.setCompressMapOutput(true) conf.set("mapred.output.compress", "true") conf.setMapOutputCompressorClass(c) conf.set("mapred.output.compression.codec", c.getCanonicalName) conf.set("mapred.output.compression.type", CompressionType.BLOCK.toString) to something like this: System.setProperty("spark.hadoop.mapred.output.compress", "true") System.setProperty("spark.h

Categories : Scala

Monitoring ZMQ queues
In general you do not want to study ZMQ's buffers (queues) but move messages rapidly into user space and monitor them yourself. One thing that is lacking in 0MQ is a kind of animation of where messages are flowing, but realistically this breaks down when you start to push hundreds of messages per second through a system, let alone millions.

Categories : Node Js

Network Monitoring
What you are seeing here is a classic case of polling a counter faster than its refresh interval. It is often the case that counters (in this case, interface counters) are updated every few seconds (10-15 seconds is a common value). If the counter updates every 15 seconds, and you ask for data every 5 seconds, then you will receive the same value once or twice in a row (depending on latency, processing time, etc.). If you receive the same value twice, then you will see a zero value for the delta (which is what your image shows). There are two ways to get around this: Ask for data less frequently than the counters are updated (30-second polling usually works fine). Obviously, if you can find out the exact refresh interval, then you can use that. Modify the configuration of your equip

Categories : PHP

Server Monitoring iOS App
No, you can't. In your case the only solution is to use Push Notifications. Local notifications is not an option for you, since you need to call a method to ping the server, but iOS won't let your app to perform any code in Background mode. You may use beginBackgroundTaskWithExpirationHandler method, but it's execution is limited by 10 minutes

Categories : IOS

Web monitoring - check url
I would rather use some of the hosted services like Pingdom. However, if you really want to have it in house, take a look at Zabbix or Nagios.

Categories : PHP

Django for a monitoring web app
It's not. This is not what Django is built for, at all. Using one thread per host you'd like to monitor isn't a very good idea either (whichever language you elect to use). You'll get better performance using a few worker processes and asynchronous processing. If you're willing to use Python, you might want to investigate using the following frameworks: Celery Twisted If you intended to use Django for its DB ORM, then you could use SQLAlchemy (or wrappers around it, such as Elixir) instead.

Categories : Django

Monitoring clipboard
I doubt it's really safe to change the contents of the clipboard while processing a WM_DRAWCLIPBOARD message - at the very least I'm surprised you don't trigger an infinite loop (since your calls to EmptyClipboard() and SetClipboardData() could be triggering another WM_DRAWCLIPBOARD message). Possibly the system has protection against that - I've never tried to find out - but it still feels wrong :) Try this version, which a) moves the clipboard update to a separate message that the window posts to itself (moving it outside of the clipboard change notification code) and b) uses a global flag to ignore changes it makes itself. (note: I think the actual bug with your code was that when you're processing WM_CREATE, windowHandler is not yet assigned. You are presumably setting that to the v

Categories : C++

Monitoring in PhpMyAdmin
You might be able to see which queries are running from Status > Monitor, in a particular time range taken from the moving graph. See http://www.youtube.com/watch?v=7ZRZoCsrKis starting at 6:00.

Categories : PHP

FIX message rate monitoring
Here is a brutal solution in gawk. If there is a 35=D on the line we use regexes to split interesting parts out, the timestamp (without the seconds so entries fall into equivalence classes on the minute level), and the two tags and dump it into a 'multidimensional' array, meaning we use these as indices of the array. Once we went through all the messages we scan the array, in no particular order, and dump the counters. It is terribly ugly..the three 'match' functions should be written as one, and perhaps the output sorted, but that's trivial in the shell with 'sort'. #!/usr/bin/awk -f #Out_Vec__PWKBVSP-LE2__0 [ 601] : timestamp=2013-08-12-13:00:01.235605858 :: latency=1323.3460000000 :: 8=FIX.4.4|9=0253|35=D|34=0000601|52=20130812-13:00:01.235|49=SENDER|56=RECEIVER|‌​57=SOR|50=TRADER

Categories : Misc

iOS debugging/NSLog monitoring from C#
By default, all NSLog statements get routed to Apple System Log (ASL), which is Apple's version of syslog. ASL can be queried using C functions (see asl_set_query, asl_search, and aslresponse_next).

Categories : C#

Monitoring directory for changes from web service
So, the scenario is simple. In a main method, the following actions are done in order: call the AFP service; poll the directory for the output file; deal with the output file. We suppose here that outputFile is a File containing the absolute path to the generated file; this method returns void, adapt: // We poll every second, so... private static final int SAMPLES = 30; public void dealWithAFP(whatever, arguments, are, there) throws WhateverIsNecessary { callAfpService(here); int i = 0; try { while (i < SAMPLES) { TimeUnit.SECONDS.sleep(1); if (outputFile.exists()) break; } throw new WhateverIsNecessary(); } catch (InterruptedException e) { // Throw it back if the method does, otherwise t

Categories : Java

Monitoring app launches on android
try this code ActivityManager activityManager = (ActivityManager) this.getSystemService( ACTIVITY_SERVICE ); List<RunningAppProcessInfo> procInfos = actvityManager.getRunningAppProcesses(); for(int i = 0; i < procInfos.size(); i++){ if(procInfos.get(i).processName.equals("com.android.browser")) { Toast.makeText(getApplicationContext(), "Browser is running", Toast.LENGTH_LONG).show(); } } find the package name using download package name viewer https://play.google.com/store/apps/details?id=com.gijoon.pkgnameviewer&hl=en

Categories : Android

Image access monitoring
I don't use php but in any web frameworks you should be able to do URL dispatching (such as using regex to route any *.jpg access), log it and then redirect it to the real image by setting in header MIME type to be 'image/jpeg' and serving the actual image file.

Categories : PHP

Monitoring the FPS of a Direct X Application
Fraps inserts a DLL into every running application and hooks specific DX calls to figure out the framerate and capture video, pretty sure that you'll have to do something similar. After a bit of poking around I found a Github project that does some basic DX hooking for doing captures and overlays, so that might be a good spot to start out with. Though I've not used it personally so I can't totally vouch for the quality. http://spazzarama.com/2011/03/14/c-screen-capture-and-overlays-for-direct3d-9-10-and-11-using-api-hooks/

Categories : C#

Monitoring the shell through python
The output you are looking for is either coming from stdout or stderr. Let's assume it's coming from stdout. (If it is coming from stderr the solution is analogous; just change stdout to stderr, below.) import subprocess PIPE = subprocess.PIPE proc = subprocess.Popen(['ls'], stdout=PIPE) for line in iter(proc.stdout.readline, ''): if line.startswith('a'): print(line) Replace line.startswith('a') with whatever condition is appropriate, and (of course) replace ['ls'] with whatever command you desire.

Categories : Python

Oracle: Monitoring changes in v_$parameter
I would create a table based on the exact structure of v_$parameter with an additional timestamp column for "last_update", and periodically (via DBMS_Scheduler) merge into it any changes from the real v_$parameter table and capture the timestamp of any detected change. You might also populate a history table at the same time, either using triggers on update of your table or with SQL. PL/SQL is unlikely to be required, except as a procedural wrapper to the SQL code. Examples of Merge are in the documentation here: http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_9016.htm#SQLRF01606

Categories : Oracle

SQLite database monitoring
use the sqlite3 shell http://www.sqlite.org/download.html c:Tools>sqlite3.exe SQLite version 3.7.17 2013-05-20 00:56:22 Enter ".help" for instructions Enter SQL statements terminated with a ";"

Categories : Windows

Monitoring Integration points
Look at the architecture of Guidewire. You OS have OS monitoring points and you have application monitoring points. The OS is straightforward using SiteScope, SNMP (with SiteScope or LoadRunner), Hyperic, Native OS tools or a tool like Splunk. You likely have a database involved: This monitoring case is well known and understood. Monitoring the services? As the application experts inside of your organization what they look at to determine if the application is healthy and running well. You might be implementing a set of terminal users (RTE) with datapoints, log monitoring through SiteScope, custom monitors scheduled to run on the host piping the output through SED to a standard form that can be imported into Analysis at the end of the test. Think Architecturally. Decompose each

Categories : Misc

Monitoring ASP.net pages CPU usage
I think you can also use perfmon(performance monitor). you can invoke it from Start -> Run -> Perfmon.exe. you can setup the counters and see on using which page there is a spike. for more details refer http://msdn.microsoft.com/en-us/library/aa645516(v=vs.71).aspx

Categories : C#

Monitoring Screensaver Events in OSX
You've commented your problem already. while(1); // busy wait's bad, I know, but easy to implement The above is almost ALWAYS a bad idea. NSDistributedNotificationCenter actually requires a running main thread NSRunLoop to operate. http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Notifications/Articles/NotificationCenters.html#//apple_ref/doc/uid/20000216-BAJGDAFC Creating and spinning a run loop from the main() of a command line application on OS X is a fairly simple thing to do. There are plenty of examples available with a quick search.

Categories : Objective C

PHP network monitoring debian
The info you need is in /proc/net/dev # cat /proc/net/dev Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed lo: 177937 1304 0 0 0 0 0 0 177937 1304 0 0 0 0 0 0 eth0:16268834 14619 0 0 0 10091 0 0 1201136 10555 20 0 0 0 0 0 For the transfer rate you will have to calculate the delta from the previous capture but the value will be approximate.

Categories : PHP

Android app for monitoring sendBroadcast() messages
It is not possible to write this as an ordinary SDK app. You cannot listen for arbitrary broadcasts, only specific ones you explicitly register for. Some broadcast information may be written to LogCat (I forget, haven't looked for that in ages).

Categories : Android

Monitoring heap in java android app
There was a very good session on this topic held by Google at Google IO 2011. Here is the link : http://www.youtube.com/watch?v=_CruQY55HOk In this video he has explained each and every GC parameter.

Categories : Android

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

Problems monitoring network bandwidth
The call "WifiInfo wifiInfo = wifiManager.getConnectionInfo()" causes the "unfortunately, xxx has stopped" error, resulting in my emulator crashing. I can't seem to get around what the issue with this is; I don't think I need to throw a try-catch block...? Where's the logcat for this? Possibly: does your app have ACCESS_NETWORK_STATE permission? A similar "unfortunately, xxx has stopped" error occurs when I input a website in urlString. When I leave the field blank, the bandwidth becomes -1, as no website gets specified, and an Exception gets thrown. Don't do network operations on the UI thread. Easy solution is to use an AsyncTask to do them on a background thread. For more info: android.os.NetworkOnMainThreadException

Categories : Java

SQL Server memory usage monitoring
Task manager shows 8GB memory usage because that's how much it is actually using. SQL Server, by design, never releases the memory that it grabs. It caches all the data that it has ever fetched from the disk and keeps it in memory so that the next query is much faster. Even if there are no connections, SQL Server will hold on to all its data so that the next connection will not have to go back to the disk to get data.

Categories : Sql Server

PHP Script for Monitoring Folder Creation
You might want to try getting your script launched with cron like every one minute and check the difference between directory lists (from before and current I mean), not the dates. It's not a perfect solution, but it will work. Check directories arays with: $dirs = array_filter(glob('*'), 'is_dir'); Compare them later with array_diff

Categories : PHP

WCF Client Channel Watchdog (Monitoring)
Too long for a comment grrr... Have you checked ServiceMon and examined it's extensibility?... look at WCF service health monitoring or simply is it possible to query each service using HTTPGet and check for content in it's response which would imply it's running?

Categories : C#

Monitoring Application Network Traffic in Qt
Some example of c# sniffer socket creation. mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP); // Bind the socket to the selected IP address mainSocket.Bind(newIPEndPoint(IPAddress.Parse(cmbInterfaces.Text),0)); // Set the socket options mainSocket.SetSocketOption(SocketOptionLevel.IP, //Applies only to IP packets SocketOptionName.HeaderIncluded, //Set the include header true); //option to true byte[] byTrue = newbyte[4]{1, 0, 0, 0}; byte[] byOut = newbyte[4]; //Socket.IOControl is analogous to the WSAIoctl method of Winsock 2 mainSocket.IOControl(IOControlCode.ReceiveAll, //SIO_RCVALL of Winsock

Categories : C++

Connection Monitoring between Arduino and Webserver
I'm not sure what you consider being your "session id", but I think you're using it more like an API key to identify your device towards the web service. Session ids are usually tokens put into cookies in HTTP requests, and are a pain to manage and track, and you don't need them for your use case. Just POST the token, and get it through the $_POST variable! And as I suggested in a comment, why don't you just make a program that sends ICMP/Ping to the Arduino, and when it does not answer, identify it as "offline"? It would be less trouble, and avoid you to add another responsibility in your Arduino.

Categories : PHP

NewRelic - monitoring cron tasks
http://blog.newrelic.com/2012/05/30/using-new-relic-to-monitor-ruby-background-tasks/ If you don't want your background tasks to affect your Apdex: https://newrelic.com/docs/ruby/blocking-controller-instrumentation Also the guys at New Relic are super helpful - don't be afraid to put in a support ticket!

Categories : Ruby

Celery chain monitoring: the easy way
I've solved deleting getProgressCod() py function and inserting an if statement inside runCod(). In this way I can monitor runFunctions() using runCod() and when it is succesfully terminated, I wait 5 seconds to get the result and then I close the task with a return. My only remaining doubt is that if this waiting approach is it correct or not... Here's my modified code: views.py def runCod(request): taskId = request.GET['taskId'] if taskId != '': # If the task is already running task = AsyncResult(taskId) currStep = task.result['step'] totSteps = task.result['total'] response = dumps({'status':task.status, 'currStep':currStep, 'totSteps':totSteps}) return HttpResponse(response, mimetype='

Categories : Django

What is org.glassfish.webservices.monitoring.WebServiceTesterServlet?
Reading the Source Code it looks to be a utility servlet for testing webservices as the name would imply. As far as how to use it? Probably best to play with it by creating an instance and playing with it some. It looks like it's designed for easy local testing, one of the constructors takes an endpoint: public WebServiceTesterServlet(WebServiceEndpoint ep) { svcEP = ep; } Read some of the comments in the source code, it seems to explain what most of the methods are for. The source itself is relatively easy to follow. I'm not sure how useful the class is overall for testing webservices but something like Soap UI is very useful for web services testing.

Categories : Java

Monitoring memory usage of self process
Thread will not work, since C and C++ mandate that returning from the main function kills all running threads (courtesy Do child threads exit when the parent thread terminates). You will need to make it another process, perhaps a script that starts the process which then manages your application.

Categories : C++

Azure Cloud Deployment - Log Monitoring
Try using Azure Explorer or the like to explore the content of your blob storage. If diagnostics is enables as you said, then Azure persist the configuration in an Azure blob named wad-control-container.

Categories : Azure

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

Monitoring a synchronous method for timeout
If you have a Task called task, you can do this: var delay = Task.Delay(TimeSpan.FromSeconds(3)); var timeoutTask = Task.WhenAny(task, delay); If timeoutTask.Result ends up being task, then it didn't timeout. Otherwise, it's delay and it did timeout. I don't know if this is going to behave identically to what you have implemented, but it's the built-in way to do this.

Categories : C#

java monitoring: Overhead of jconsole?
This article https://weblogs.java.net/blog/emcmanus/archive/2006/07/how_much_does_i.html says remote monitoring of jconsole produces an overhead around 4%. Check the article to get your own conclusions.

Categories : Java

Time Log Monitoring System PHP/MySQL
Making a few assumptions (that you fields are just varchar), the following will get you the start and end time of shifts. You can use this as a sub select and join it against the breaks to get the results you want. SELECT a.ACNo, STR_TO_DATE(CONCAT(a.Date, ' ', a.Time), '%m/%d/%Y %h:%i:%s %p') AS StartTime, MIN(STR_TO_DATE(CONCAT(b.Date, ' ', b.Time), '%m/%d/%Y %h:%i:%s %p')) AS EndTime FROM CheckIn a INNER JOIN CheckOut b ON a.ACNo = b.ACNo AND STR_TO_DATE(CONCAT(b.Date, ' ', b.Time), '%m/%d/%Y %h:%i:%s %p') > STR_TO_DATE(CONCAT(a.Date, ' ', a.Time), '%m/%d/%Y %h:%i:%s %p') GROUP BY a.ACNo, STR_TO_DATE(CONCAT(a.Date, ' ', a.Time), '%m/%d/%Y %h:%i:%s %p') Not sure on the format of your breaks table to go further with this. By the way, it would likely be FAR easier to do if rather th

Categories : PHP

Monitoring django postgres connections
You should try the django-debug-toolbar. Among many other options, you can monitor the queries to the database for each page and the response time. This is a screenshot from the plugin documentation:

Categories : Django



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