php-Magento: monitor the execution time of all cron jobs?
I inherited a website based on Magento Enterprise 1.9, which has a lot of cron jobs that run regularly.
These cron jobs are configured by third-party modules and are not part of Magento's core.
A set of jobs handle the export and import of data files from Magento to the warehouse management system.Sometimes the cron job gets stuck in some kind of loop and it only takes a few minutes to process it for several hours.
I want to monitor the time spent on these jobs in some way, but not modify each script itself. Maybe some kind of observer, is it possible if that is the case?
Any ideas?
Solution:
Build a script that executes the formatted table created from the cron_schedule table.
I know common things about publishing links, but MagentoCommerce.com may not disappear anytime soon, and getting the code to publish here is Royal PITA. So here's the link to a PHP script that reads cron_schedule and creates a full report. See the bottom code Enter the system to configure cron settings and tell it to save the information for 24 hours.
You can now see everything that is being planned and everything that has been executed, as shown in the following output example.
Sorry for the MageBayvaporation on the link, I tried to move the most important thing here, but missed this. Fortunately, it still runs on one of the sites.
global->resources->default_setup->connection->host;$db['name'] = $xml->global->resources->default_setup->connection->dbname;$db['user'] = $xml->global->resources->default_setup->connection->username;$db['pass'] = $xml->global->resources->default_setup->connection->password;$db['pref'] = $xml->global->resources->db->table_prefix;$tables = array( 'dataflow_batch_export', 'dataflow_batch_import', 'log_customer', 'log_quote', 'log_summary', 'log_summary_type', 'log_url', 'log_url_info', 'log_visitor', 'log_visitor_info', 'log_visitor_online', 'catalog_compare_item', 'report_event', 'report_compared_product_index', 'report_viewed_product_index', 'sales_flat_quote', 'sales_flat_quote_address', 'sales_flat_quote_address_item', 'sales_flat_quote_item', 'sales_flat_quote_item_option', 'sales_flat_quote_payment', 'sales_flat_quote_shipping_rate');} else { exit('Failed to open ../app/etc/local.xml');}/** Get current date, time, UTC and offset **/$date = date("Y-m-d");$time = date("H:i:s T");$offset = date("P");$utc = gmdate("H:i:s");/*********************** * Start HTML output ***********************/echo 'Magento Log File Contents on ' . $date . ' ' . $time . '';/** Output title, connection info and cron job monitor runtime **/echo 'Magento Log File Contents Report
Connection: '.$db['user'].'@'.$db['host'].' – Database: ' . $db['name'] . '
';echo 'Runtime: ' . $date . ' ' .$time . ' ' . $utc . ' UTC
';echo 'Note: Your timezone offset is ' . $offset . ' hours from UTC
';/** Connect to database **/$conn = mysql_connect($db['host'],$db['user'],$db['pass']);@mysql_select_db($db['name' ]) or die(mysql_error());/*********************** * Get table record counts *********** ************/echo'';echo'';foreach($tables as $tblname) {$result = mysql_query('SELECT COUNT(*) FROM '. $db['pref' ]. $tblname) or die(mysql_error()); $numrows = mysql_fetch_array($result); $num = $numrows[0]; echo''; echo''; echo''; echo''; }echo '
Log Tables | |
---|---|
Table | Row Count |
'.$db['pref'].$tblname.' | '.$num.' |
php-Magento: monitor the execution time of all cron jobs? Related posts
- javascript - when the value increases, the height of the textarea increases, but when the value decreases, the height of the textarea does not decrease
When the textarea overflows, it gets the scrollbar and scroll height, it gets applied to its height, but can't be used to reduce the textarea height, because reducing it's value length it doesn't get the scrollbarSolution:The minimum scrollHeight of a textarea is always the height. To get an accurat ...
- Because of the keywords selected in the HTML, the javascript in the form-the reset button will not reset the selection to the first element
I have a reset button in the formAnd some optionsABIf I click reset, nothing happens. Here is an example.Edit:I thought the reset button would reset to the first value of the select list. This seems to be a misunderstanding to us. I want to reset to the first element of the selection.So what is the ...
- javascript-group the objects in the array according to the value of the key in the object
I have the following data and I want to sort by date-not including timestamp.Note: I can access the moment of this task.My data looks like this:const data = [{"fixture":"AC v Inter","kickOffTime":"2018-06-14T15:00:00Z", }, {"fixture":"DC v NYC","kickOffTime":"2018 -06-15T12:00:00Z", }, {"fixture":"A ...
- Use the "super" in the subclass and the "this" in the superclass to select the Java runtime method
I found this apparently weird behavior in Java's method overriding/overloading, which is unbelievable. The call in the Main() method prints"B_A", and I want it to be"B_B".package one; public class A { public void method(A a){ System.out.println("A_A");} public void method(B b) {System.out.println("A_B");} public void method(){ this.method(this);} } package one; public class B extends A { public void method(A a) {System.out.println("B_A");} public void method(B b) {System.out.println("B_B");} pub ...
- Through the operation of the applet, use the product manager to analyze the situation of the applet
Product name: Turing IndexMain function: This is a good ranking of the AI industry, such as which robot is better, smarter, etc.!The main purpose is to make it authoritative, so that it can better achieve its due value.This is its small program code, I am a back-end plus a front-end, through technology and other methods to achieve this small program.Then, my side mainly continued to work on personal needs, and continued to do it, mainly to make the list of AI star companies, this piece of conten ...
- c#-Pass the List to the method, modify the list in the method without affecting the'original'
Sorry, if the subject seems vague, I try to summarize it as much as possible, without knowing the exact terminology I want to reach.Basically I have a list and then I call a methodpublic ListmyList; void Start () { myList = new List(); myList.Add (1); myList.Add (2); doSomething(myList); foreach (int i in myList){ print (i); } }In my method, I want to do this (for example)public void doSomething (ListmyPassedList) { int A = 5; myPassList.Add (A); //... And then some other cool code with thi ...
- JAVA get the length of the string, link the string, get the value of the string index position, get the index position of the value
package Code503; public class CodeStringGet { public static void main(String[] args) { //Get the length of the string int length ="huanduchenyu".length(); System.out.println("The length of the string is:"+length); String str1="Huandu";String str2="Chenyu"; //Link String String str3=str1.concat(str2) ...
- javascript-The mouse on the left side of the screen moves the image to the left, the same as the mouse on the right side of the screen
I am trying to get an image of about 1920x1200px to pan in a browser window of 800x600px. Therefore, if my mouse is in the upper left corner of the browser window, the image will be dropped, so its upper left margin is in the browser window The upper left corner of the. The same is true for the lower right corner.Therefore, if the mouse is in the center of the screen, the image should also be centered.Since my math is a bit rusty, I'm not sure what calculations are needed.Currently, I'm using so ...
- java-the static method in the subclass has the same signature as the signature in the superclass
"You can write a new static method in the subclass that has the same signature as the signature in the superclass, thus hiding it."This is the sentence I read from the Oracles authorised site for java tutorial.I try to implement the above concepts in this way:Parent class:public class E {public void ...
- The given contour outlines the edge of the'S' shape in OpenCV/Python. What methods can be used to trace the curve along the center of the shape?
If the outline outlines the edge of the letter S (for example, in a comic), how can I get a series of points along the spine of this letter so that I can later use straight lines, cubic splines, or other curve representation techniques to represent this shape? I want to use 30-40 points in Python/Op ...
- The realization of the photo function of the applet and the display of the photo
index.wxml pageCamera photo function Click to take photo index.js page takePhoto(){ wx.navigateTo({ url: '/pages/photo/photo', //Jump to a custom photo page }) }, photo.wxml page totakephoto .js pagePage({ /** * The initial data of the page*/ data: { image:'' }, takePhoto:function(){ var _this=this ...
- javascript-When the category in the form submission is the same, what is the difference between the button and the span.
I overcame the span and button issues when using ajax call to submit the form.This is my code with button:GenerateThis is my code span:Generatejavascript generation starts here.....$("#gdBasic").click(function () {///////////////Ajax call is inside.//////////////// //});My problem is that the tab sp ...
- The Future of the iPhone X: From the Realistic to the Absurd
by benjamin bannisterThe Future of the iPhone X: From the Realistic to the AbsurdLet’s imagine the iPhone in the far future. Image: benjamin bannisterAs a user and fan of the iPhone, I filmed a spoof video for an imaginary product called The iPhone X3.Let’s discuss the ideas presented in it, and exp ...
- javascript-Using Monit, Daemonized Node.js fails every 60 seconds
The master of SOI use monit & run Node.js as a daemon process and it turns out that it fails every 60 seconds at the point. Here is my [email protected]:/etc/monit# tail -f /var/log/monit.log[UTC Sep 4 12:07:50] info:'nodejs' start: /sbin/start[UTC Sep 4 12:08:50 ] error:'nodejs' failed, canno ...
- php-explode the string, and set the key of the array for the text before the delimiter?
Is there a way to accept input like this:|testing==one two three|setting==more testing|And get something like thisarray['testing'] ="one two three";array['setting'] ="more testing"Now, I just decompose the string and set up the array with numbered indexes, but I want the user to be able to enter the ...
- python - Why do the colors of the points in the scatter plot not match the colors of the points in the corresponding legend?
I have a sample scatter plot via matplotlib via the code below.import numpy as np import matplotlib.pyplot as pltx = np.linspace(0, 100, 501)y = np.sin(x)label = 'xy data sample'plt.scatter(x, y, cmap='plasma', c =x, label=label)legend_dict = dict(ncol=1, loc='best', scatterpoints=4, fancybox=True, ...
Recent Posts
- python crawler 28 | The data you climb down does not analyze a wave, you will lose it, use python for data visualization
Through this timeXiaoshuai b teaches you to start from catching the bagTo data crawlingTo data analysisTo data storageI believe you can already crawl most of the website data you want to crawlcongratulationsbutData captureAnalyze the waveThe best way is to visualize the dataOnly in this way can you ...
- Android: Compilation error: Task': app: compileDebugJava' failed to execute
I am facing the following error:Error:(89, 39) error: incomparable types: CAP#1 and int where CAP#1 is a fresh type-variable: CAP#1 extends Object from capture of? Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Error:Execution failed for...
- javascript-Click in the browser or use history.go(-1) to delete specific fields
I have a form with capacity, if the capacity is entered incorrectly,"history.go(-1)"is being executed after the page is submitted and all fields including capacityha input are returned to the screenNow I have a clear js-but now I need it in several places, I want to know if it is possible to clear a...
- Java Interview Questions (Mybatis)
1. What is Mybatis?1. Mybatis is a semi-ORM (Object Relational Mapping) framework, which encapsulates JDBC internally. You only need to pay attention to the SQL statement itself during development, and you don't need to spend energy to deal with complicated processes such as loading drivers, creatin...
- What is an event in C#?
What is an event in c#? Is it similar to ActionScript Event? Is it different? In what?Solution:An event in C# is a way for a class to provide notifications to clients of that class when some interesting thing happens to an object. The most familiar use for events is in graphical user interfaces; typ...
- JavaScript common array manipulation methods, including ES6 methods
One, concat()The concat() method is used to concatenate two or more arrays. This method does not change the existing array, only returns a copy of the connected array.var arr1 = [1,2,3];var arr2 = [4,5];var arr3 = arr1.concat(arr2);console.log(arr1); //[1, 2, 3]console.log( arr3); //[1, 2, 3, 4, 5]T...
- python-Does groupby automatically group all non-numeric columns in pandas?
I have an example of the following data set (only the first few rows are shown, but there are 193 rows):country,beer_servings,spirit_servings,wine_servings,total_litres_of_pure_alcohol,continentAfghanistan,0,0,0,0.0,AsiaAlbania,89,132,54,4.9,EuropeAlgeria,25,0,14,0.7,AfricaAndorra,217,245,138,312,12...
- python-when the list index is out of range, surround the list
I am looking for some code improvements, or a pre-built version of my own implementation, because I think it may or should be a clearer way to achieve what I want.I'm writing a software to convert guitar labels to classic notation, and I need to convert the numbers on the labels to the corresponding...
- Can I do 302s for the architecture in my web application?
For example, in my index (request):def index(request): if logged_in: return HttpResponseRedirect("/home_profile") else: return HttpResponseRedirect("/login")This way, when the user clicks on my homepage... he will be redirected appropriately. Is this a good architecture? Or will it cause caching iss...
- java – Can @Lazy initialize a Spring @Value?
Is it possible for @Lazy to initialize a Spring @Value?For [email protected]@Value("${someConfig}")private String someConfig;The scenario I specifically mentioned is a variable set through JNDI, and an embedded Tomcat container, which has some of it's JNDI variables initialised during Spring Boot loading...