w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to monitor the computer's cpu, memory, and disk usage in ASP.NET?
Perfomance counters is my advice. Check out Setting up performance counters for ASP.NET Beyond performance counters, if you really want to get an 'inside' look at your code, then you can try a memory profiler, such as the following: CLR Profiler - free Red Gate's ANTS Memory Profiler - NOT free Visual Studio 2012 Memory Profiler - may be free depending upon which version of VS2012 you have

Categories : Asp Net

Script to send alert mail if disk usage exceeds a percentage
You can use the df command to check the file system usage. As a starting point, you can use the below command: df -h | awk -v val=90 '$1=="/pqr"{x=int($5)>val?1:0;print x}' The above command will print 1 if more than threshold, else print 0. The threshold is set in val. Note: Please ensure the 5th column of your df output is the use percentage, else use appropriate column.

Categories : Shell

Calculate Percentage in MySQL Query
Something like that SELECT machine , COUNT(DISTINCT machine) AS "nb" , COUNT(DISTINCT IF(qc_gsr = "green" AND qc_hr = "green" AND qc_acz = "green" AND qc_bre = "green" ), machine, NULL) ) AS "green_nb" , COUNT(DISTINCT IF(qc_gsr = "green" AND qc_hr = "green" AND qc_acz = "green" AND qc_bre = "green" ), machine, NULL) ) / COUNT(machine) * 100 AS "%" FROM rtcdb.session WHERE project = "CSC032" GROUP BY machine ;

Categories : Mysql

Calculating Percentage within a MYSQL Group
SELECT SUM(o.withinfix) 'Total', SUM(o.withinfix) / (select SUM(withinfix) from opencall) * 100 as perc o.priority 'priority' FROM opencall o WHERE LEFT(FROM_UNIXTIME(o.logdatex),4) = "2013" AND o.fk_company_id = "abc" GROUP BY o.priority

Categories : Mysql

MYSQL Query with percentage and other restrictions
Here's how you'd get the city-to-country percentage, by country. I'm OK with telling you this because you were very close with the query you published above. SELECT City.Country, SUM(City.Population) / Country.Population * 100 AS CityPopulationPercentageOFCountryPopulation FROM City INNER JOIN Country ON City.Country = Country.Code GROUP BY City.Country Has your instructor covered inline views, where a subquery is used like a table? I hope so, because that's how you'd include the calculated column with each city. Here's a simplified version with City ID, City Name, City Population, Country Code, and City Population percent: SELECT City.ID, City.Name, City.Country, City.Population, PopPercent.CityPopulationPercentageOFCountryPopulation FROM City INNER JOIN ( SELECT

Categories : Mysql

Get how many percentage where statement match mysql
for example if you have a table named users you can do something like this: $where = $db->query("SELECT * FROM users WHERE username LIKE '%mo%'")->rowCount(); $all = $db->query("SELECT * FROM users")->rowCount(); $percentage = ($where / $all) * 100;

Categories : Mysql

Percentage width list grid layout with percentage left margin on
  • and negative percentage left margin on the
  • you are trying to give width in % and each item width is 32% which becomes 32*3 becomes 96% and with marign of 2% on each item it becomes total 102% and ur width is 100% and current list will always take the width according to your container width whether u use margin or not you should divide container width on total list item including with the margin http://jsfiddle.net/6DEv9/2/ use this li { width: 31%; float: left; margin: 0 0 0 2%; list-style: none; }

    Categories : CSS

    How to detect the disk full error and let program resume after getting free disk space
    Check the return value of each call to fprintf() and fwrite(). If either call returns a negative value, check errno to see if errno is equal to ENOMEM or EDQUOTA. If so, you're probably out of disk space. As for resuming the operation as if nothing ever happened; that's a little bit harder; you'll need to keep track of what data you successfully wrote to the disk, so that after you've notified the user and they've indicated that it's time to try again, you can resume writing that data from the point at which the error occurred. That means keeping the state of the write in a structure of some sort (i.e. not just on the stack) so that you can return from your writing-function and then resume it later on. (Either that, or do the writing in a separate thread, and have the thread notify th

    Categories : C++

    Store common queries on disk with Mysql and windows
    Why not consider something like Redis for caching? It's an in memory data store and it's very popular right now. Sites using Redis: http://blog.togo.io/redisphere/redis-roundup-what-companies-use-redis Redis also can persist data to disk: http://redis.io/topics/persistence For caching though, saving to disk shouldn't be absolutely critical. The idea is that if some data is not cached, the worst case is not always loading from disk manually, but going straight through to your database.

    Categories : Mysql

    Slow MySQL query is filling up my disk space
    where is WHERE clause : create temporary table temp_ids_codes select ID, CODE from temp_ids, temp_codes; table should have PK on collumnsID, CODE

    Categories : Mysql

    Mongodb exists after claiming that there is no disk space while disk was not full
    This is a bug in MongoDB. As of today it remains unresolved. The best advice I can give you is to ensure you have plenty of available disk space at all times.

    Categories : Mongodb

    How do you monitor a file on a web server and log every access, ideally by IP address, in a database (MySQL)?
    The Apache HTTP Server provides logging capabilities. The server access log records all requests processed by the server. The location and content of the access log are controlled by the CustomLog directive. The LogFormat directive can be used to simplify the selection of the contents of the logs. This section describes how to configure the server to record information in the access log. It can be used to write the log to a file. If you need to store in a MySQL table, run a cron job to import the file into the database. Further information on logs is here: http://httpd.apache.org/docs/1.3/logs.html#accesslog

    Categories : PHP

    Using Performance Monitor to monitor pooled connections
    You can run this from a SQL query windows to get a count and the details of current connections and session running on your SQL server. select * FROM sys.dm_exec_sessions AS es INNER JOIN sys.dm_exec_connections AS ec ON es.session_id = ec.session_id I've had trouble with pooled connections. They're hard to control. Explicitly closing them never seemed to work since they're under the control of .NET. The biggest reason we've run out of connections is uncommitted transactions. If a transaction is left uncommitted or rolled back for some reason, the connection, instead of being re-used, get's stuck in limbo, forcing .NET to open yet another connection to continue processing.

    Categories : Sql Server

    Calculate percentage ratio from sum amount in mysql database in php
    Here's how I finally did it <?php $query = "SELECT * from stats where user_id='".$nameID."' $where order by week desc"; $result = mysql_query($query) or die(mysql_error()); $worked_week = mysql_num_rows($result); if(mysql_num_rows($result)) { $k = 1; while ($row_stats = mysql_fetch_array($result)) { // Total Section // $total_worked_hours=$total_worked_hours+$row_stats['worked_hours']; $total_sales=$total_sales+$row_stats['sales']; $total_sales=number_format($total_sales,2,'.',''); $total_facials=$total_facials+$row_stats['facials']; $total_double_facials=$total_double_facials+$row_stats['double_facials']; $total_classes=$total_classes+$row_stats['classes']; $total_faces_viewed=$

    Categories : PHP

    Gradient to cell acording to percentage??Percentage is calculated by some array values
    You can generate the same webkit-gradient string dynamically. I've updated your jsfiddle here with what I think you mean. The relevant code is below. .style('background', function(d) { if(d.value) { var col = d3.rgb(colors(d.value[0])); return "-webkit-gradient(linear, left top, right top, color-stop(0%," + col.darker(3) + "), color-stop(" + (d.value[2] * 100) + "%," + col + "), color-stop(100%," + col.brighter(3) + "))"; } else { return "white"; } }) The methods .darker() and .brighter() are provided by D3 and do what they say -- you may want to replace them with custom start/end colours.

    Categories : Javascript

    Need Help on Calculate Percentage of Failure of All Columns in Very Large MySQL Table
    You can use case and find all possible scenario in a single select hit. It will reduce your time. example select id, count(*), sum(case when col1 between 0 and 10 then 1 else 0 end) col1_yes, sum(case when (col1 not between 0 and 10) and (col2 between 0 and 10) then 1 else 0 end) col1no_col2yes from table group by id;

    Categories : Mysql

    AIX 7.1 failed disk, need to figure out what physical disk this is?
    Use diag. $ diag <enter> Task Selection Hot Plug Task SCSI Hot Swap Manager Identify a Device Attached to a SCSI Hot Swap Enclosure Device It should blink the LED of the device you requested.

    Categories : Misc

    Monitor.Enter vs Monitor.Wait
    According to MSDN: Monitor.Wait Method(Object) SynchronizationLockException: The calling thread does not own the lock for the specified object. In other words: You can only call Monitor.Wait(Object), when you already own the lock, whereas you call Monitor.Enter(Object) in order to acquire the lock. As for why Monitor.Wait is needed: If your thread realizes, that it is lacking information to continue execution (e.g. it's waiting for a signal), you might want to let other threads enter the critical section, because not all threads have the same prerequisites. For the waiting thread to continue execution, you will need to call Monitor.Pulse(Object) or Monitor.PulseAll(Object) before releasing the lock (otherwise, you're going to get the same kind of exception as with Monitor.Wait(Ob

    Categories : C#

    Cloning an OS disk onto a smaller disk
    Acronis Clone Disk worked for me with some options settings, set the move method to Manual and then we get the option to "Change Disk Layout" and control how the unused space from the bigger disk will be shrunk when moving to smaller disk.. The destination disk is fine and bootable now!

    Categories : Misc

    Error "Task can be only monitored with a single monitor" when setting my monitor to a task in dll
    OnMessage function creates implicit monitor which receives the task message and calls your anonymous function. Same goes for OnTerminated. If you wish to use MonitorWith, you should implement message processing and termination handling as a monitor events, not with OnMessage/OnTerminated functions.

    Categories : Delphi

    Inserting a textbox (percentage sign) in the gridview that allow user to enter a percentage in the textbox, then populating the cells at the botton
    What will you do with 3 rows of percentage textboxes?What does each row of percentage textbox take the percentage of?Is it the percentage of the sum of all the numbers above?Then why do you need 2 more rows filled with percentage textboxes? I understand you want to add dynamic code because the number of rows from stored procedure may change everytime.I have simplified your code: private void AssignCellCoordinatesIndividual(GridView gv) { // Create IDs for Grid for (int i = 0; i < gv.Rows.Count; i++) { gv.Rows[i].ID = "r" + i; // Row ID for (int ii = 0; ii < gv.Rows[i].Cells.Count; ii++) { gv.Rows[i].Cells[ii].ID = "c" + ii; // Cell ID int RowCount=gv.Rows.Count; if ((in

    Categories : Asp Net

    Auntie Dot API Utilization
    Unfortunately, this is an API for the Microsoft .NET Framework only. I have heard rumour of a partially-complete version for PHP, however I have never personally seen it. Auntie Dot doesn't quite work right either - if that makes you feel any better. I run a website with Halo 4 stats (http://grifball.net) and let me tell you, they really don't make it easy to get your hands on those numbers!

    Categories : PHP

    CPU Utilization on Redhat 6
    usleep parameter is MILLIONTHS of seconds, not thousandths. micro vs milli. Add three more zeroes and I think you'll see what you expect. http://linux.die.net/man/3/usleep The usleep() function suspends execution of the calling thread for (at least) usec microseconds

    Categories : C

    get current CPU utilization in C#
    That's because you need to call NextValue multiple times on the same PerformanceCounter instance (so at least twice). The first call will always return 0. You can work around this (sort of) by calling NextValue twice in your Page_Load event handler, only storing the return value of the second call: float cpuUsage = 0.00F; this.theCPUCounter.NextValue(); cpuUsage = this.theCPUCounter.NextValue(); The reason it shows in the QuickWatch of the debugger is probably just because it is (implicitly) called multiple times (once by the program and once by the debugger for the QuickWatch value). Update to the "sort of" above: As others have mentioned you usually need to sleep some time between the two calls to actually observe a difference in CPU load that results in a

    Categories : C#

    How to monitor specific folder and save content of each log file in that folder to mysql database
    First of all, congratulations! You are in front of a beautiful problem. My suggestion is to use divide and conquer. Here are my considerations: Put the relevant folder(s) under version control (for example, GIT) Check via GIT commands the files that changed every X amount of time. Also obtain the differences between the prior version of each file, and the new ones, so you can update your database parsing the new info. Just in case, here are ways to call system commands from ruby. Hope that helps,

    Categories : Mysql

    How to replace percentage value to replace with some string value in percentage specific 2d horizontal fusion charts
    give numbersuffix='%25' to display '%' as suffix sample : http://www.fusioncharts.com/free/docs/Contents/Adv_SpChar_Percent.html

    Categories : Misc

    Audit logout - high CPU Utilization
    According to the BOL article on that event, the CPU is the aggregate CPU used for that connection over its lifetime. So the event itself isn't consuming any CPU, but rather is reporting all of the CPU that's been used by that session since connecting.

    Categories : Sql Server

    High CPU utilization during oracle group by
    You are using an aggregate function. If the table has 32 Million rows and you are attempting to aggregate all values in these columns, what were you expecting Oracle to do? Sit in an Idle state? An aggregate on this much data is going to take time!!! The time taken for the group by clause is dependent on the number of distinct values in columns 1 to 8. Before the group by is performed, the database would first have to retrieve all values for these columns and then order it "nicely" as you have requested, then insert it. Furthermore the query looks bad in general. Why would you do the aggregate sum on each column, only to potentially lose the value when doing the group by? E.G if you have duplicate values in columns 1-8 the sum *may * be calculated more than once for no reason. Since you

    Categories : Oracle

    Working Out Utilization Time MSSQL Query
    To find the time used select convert(datetime,sum(convert(float, EndTime-StartTime))) from yourtable To find the time missing, subtract that from select Max(EndTime)-min(StartTime) from yourtable ie: select convert(datetime,sum(convert(float, EndTime-StartTime))) , Max(EndTime)-min(StartTime) - convert(datetime,sum(convert(float, EndTime-StartTime))) from yourtable This assumes there are no overlapping elements of time.

    Categories : SQL

    Java : Matcher.find using high cpu utilization
    Avoid expresions with: Multiline case insensitive etc. Perhaps you can consider grouping regular expressions and apply a given group of regular expresions depending on user input.

    Categories : Java

    Hive tips for reducing 100 % Cpu utilization on amazon EMR
    How is the memory usage on the nodes during this query? As @Charles Menguy said in the comments, high cpu usage isn't inherently a bad thing. You may consider using more, larger nodes to complete the job in a shorter amount of time. It may take some experimentation, but this may even be cheaper for you. For example, we discovered that switching to larger nodes(we use m2.xlarge) allowed our jobs to run faster per dollar than our original use of more m1.large instances.

    Categories : Hadoop

    100% CPU utilization in either gettimeofday, QTime or QLabel->setText
    deadman->start(10); // 10 ms; (Note: answer written before question was fixed to have 100 ms interval) You have 10ms interval here, which is 100Hz, not 10Hz. In your question you say "the system I'm working on runs for days and days", so it sounds like you have an embedded system of some sort? Maybe it has trouble keeping up with 100Hz timer. Note that updating the label 100 times a second will cause QWidget::update() to be called that often, and the widget will be painted from event loop very often, even if you do not call repaint() (which you should not do anyway).

    Categories : C++

    Difference between Space utilization and Load factor in hashtable
    Load factor is a measure of how full the hash table is filled with respect to its total number of buckets. Lets say, you have 1000 buckets and you want to only store a maximum 70% of this number. If load factor ratio exceeds (more than 700 elements are stored) this maximum ratio, hash table size can be increased to effectively hold more elements . Space utilization is the ratio of the number of filled buckets to the total number of the buckets in a hash table. Usually, when load factor increases, space utilization increases and in an ideal hash table, load factor and space utilization should be linearly related to each other. However, in most cases, space utilization is a sublinear function of load factor because some buckets are assigned to hold more than 1 elements in case of high loa

    Categories : Database

    How to measure each core CPU utilization/load (in %) in Micromax C4, using adb command?
    I am not sure if there is any file which will be able to directly report the percentage CPU utilization but you can use /proc/stat to calculate the CPU utilization. adb shell cat /proc/stat gives the following output cpu 22251 758 19056 1170320 2786 0 243 cpu0 13628 401 14782 275769 1645 0 237 cpu1 4712 147 2394 295111 622 0 5 cpu2 2451 116 1149 298977 291 0 1 cpu3 1460 94 731 300463 228 0 0 intr 724661 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 184059 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 337 0 0 0 0 0 0 0 0 0 0 0 14401 0 0 21902 0 0 6 0 0 0 0 0 0 0 0 0 0 48850 175 0 0 0 0 0 0 0 0 0 0 0 0 2901 16819 5708 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8879 0 31124 0 0 0 0 5431 0 579 0 5 0 0 0 0 0 15043 0 0 0 0 0 6644 328 13085 0 6779 0 70695 1279 47348 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

    Categories : Android

    PHP MySQL query: match two tables with percentage match
    Try below: SELECT e_id, e.skill, c.skill, (e.points/c.points)*100 from employee_skills as e, company_skills as c WHERE e.skill = c.skill GROUP BY e.e_id,e.skill See below: SELECT c.skill, total_emp_points, c.points as total, (total_emp_points/c.points)*100 as percnt FROM company_skills AS c, (SELECT e.skill, SUM(e.points) as total_emp_points FROM employee_skills as e GROUP BY e.skill) as emp WHERE c.skill = emp.skill; see SqlFiddle

    Categories : PHP

    Horizantal children divs- fixed width and percentage width- percentage width too wide
    Here is the answer: http://dabblet.com/gist/6069015 Only need to specify the side column's floating and the rest will take place as you want, adapting the screen size as well. Hope it helps!

    Categories : HTML

    how to calculate the Memory utilization in % of SunOS NMSPM 5.10 Generic_138888-03 sun4v sparc SUNW,T5440
    Here is one way to do it: #!/bin/ksh memtotal=$(( $(kstat -p unix:0:system_pages:pagestotal|nawk '{printf "%d",$2}') * $(pagesize) / 1024 )) swapstat=$(swap -l|tail +2) swaptotal=$(( $(echo "$swapstat" | nawk '{total=total+$4}END{print total}') * $(pagesize) / 1024 )) swapfree=$(( $(echo "$swapstat" | nawk '{used=used+$5}END{print used}') * $(pagesize) / 1024 )) swapused=$(( swaptotal - swapfree )) memfree=$(vmstat 1 2 | tail -1 | nawk '{print $5}') printf "%-16s %12s %12s %12s %12s %12s " "Memory$(hostname)" memtotal swaptotal memfree swapfree swapused printf "%-16s %12d %12d %12d %12d %12d " $(date +%H:%M:%S) $memtotal $swaptotal $memfree $swapfree $swapused echo printf "RAM utilization: %5.2f %% " $(((memtotal-memfree)*100/memtotal)) printf "SWAP utilization: %5.2f %% " $((swapuse

    Categories : Linux

    Maximize resource utilization given multiple types of resources and specific mixtures of resources per task
    This sounds just like a multiple knapsack problem - the only thing you need to change is to assign each item value that is equal to the sum of the items it use, then it becomes a standard knapsack since while maximizing the sum, the remainder is minimized.

    Categories : Algorithm

    azure powershell commandlets for vms metrics like cpu utilization ,network in , network out
    I'm not sure if API for metrics even exists. But the good news here is if you have Diagnosticts setup as it is described here http://www.windowsazure.com/en-us/develop/net/common-tasks/performance-profiling/ you will have performance counters information stored in your WADPerformanceCountersTable table.

    Categories : Azure

    How to monitor changes in a website?
    You have set timer interval to 5000 milliseconds which makes it 5 seconds only. So your code will run every 5 seconds. If you want to run your timer every minute, you should set it to 1000x60=60000 ms. I hope this helps.

    Categories : C#



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