CN108959021A - It is a kind of to carry out the method and system that NAS order executes time statistics using script - Google Patents
It is a kind of to carry out the method and system that NAS order executes time statistics using script Download PDFInfo
- Publication number
- CN108959021A CN108959021A CN201810614036.7A CN201810614036A CN108959021A CN 108959021 A CN108959021 A CN 108959021A CN 201810614036 A CN201810614036 A CN 201810614036A CN 108959021 A CN108959021 A CN 108959021A
- Authority
- CN
- China
- Prior art keywords
- time
- file
- log
- script
- temporary file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3037—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3065—Monitoring arrangements determined by the means or processing involved in reporting the monitored data
- G06F11/3072—Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3409—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
- G06F11/3419—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3466—Performance evaluation by tracing or monitoring
- G06F11/3476—Data logging
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Mathematical Physics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The method and system that NAS order executes time statistics are carried out using script the present invention provides a kind of, include the following steps: 1) perform script, and create for saving the temporary file for executing the time;2) it counts each NAS order and executes the time, and be saved in temporary file;3) maximum execution time in each NAS order execution time is calculated, minimum executes time, average calculation times, and is saved in temporary file.For the program by writing script, the automatic statistical test for carrying out NAS order duration saves the testing time, facilitates the progress of test.
Description
Technical field:
It is ordered the present invention relates to a kind of couple of NAS (Network Attached Storage) and executes time progress automatically
Change statistics, obtains average time, maximum duration and the method and system of shortest time.
Background technique:
In the prior art, well known technology is AS18000G2 storage product on the basis of unified storage, increases NAS
Function realizes that the function of console module increases and optimizes, not only supplements company's storage product line, but also enrich Products scheme
Combined diversification.It is an important component in NAS test, project initial stage NAS that wherein the order of NAS cluster, which executes duration,
Order executes duration and generally grows partially, it is optimized in the later period, and each version needs to test the duration of NAS related command, with
Just it is compared with before.In the test of NAS order duration, each order is needed to be implemented 10 times, and is obtained and executed duration
Average value, maximum value and minimum value, wherein NAS has tens of kinds of orders, if manually performed, expends more time and essence
Power is unfavorable for the quick progress of test, so needing one kind that can automate carries out the test method that NAS order executes duration., this
It is existing deficiencies in the technology.
Summary of the invention:
The purpose of the present invention is to deficiencies of the prior art, and provide it is a kind of utilize script carry out
NAS order executes the method and system of time statistics, and the program is by writing script, the automatic statistics for carrying out NAS order duration
The testing time is saved in test, facilitates the progress of test.
This programme is achieved by the following technical measures: a kind of to carry out NAS order execution time statistics using script
Method, include the following steps: 1) perform script, and create the temporary file for saving the execution time;Need Run Script
When, execute ./Test.sh parameter 1.2) it counts each NAS order and executes the time, and be saved in temporary file;3) it calculates each
Maximum execution time, minimum execution time, average calculation times in the NAS order execution time, and be saved in temporary file.
In this way when needing to carry out time statistics, Run Script can thus unite in entire NAS order implementation procedure
Meter, does not need manually to count one by one.
Temporary file in step 1) includes the temporary log file for storing average value, maximin, for depositing
The temporary file of all implementing results is put, the temporary file of institute's having time is stored.
Temporary file for storing average value, maximin is log_ " $ 1 ";For storing all implementing results
Temporary file is log;For storing, the temporary file of having time is log_alltime_ " 1 ".In this way perform script it
Just, these files are created that, convenient for storage time information timely in statistic processes.
In step 3), after being saved in temporary file, by the log_ " $ 1 " and log_alltime_ " $ in temporary file
1 " specified folder is arrived in storage.After temporary file storage to specified file, former temporary file is all deleted.It will not account in this way
With additional memory space.
For the system of above-mentioned statistical method, including acquisition monitoring module, statistical module, memory module, output module;It adopts
Collection monitoring module acquires the execution duration of each NAS order for starting script operation;Statistical module is for counting all NAS
The duration executed is ordered, and extracts maximum time and minimum duration, calculates average duration;Memory module is for creating storage
Average value, maximin, all implementing results temporary file, storage average value, maximin temporary log text
After part and the temporary file of storage institute's having time are output to specified folder, all temporary files are deleted;Output module is used for
Output storage average value, maximin to specified folder.Monitoring module starting monitoring is acquired, and acquires every subcommand and executes
Time and will send information to memory module and stored, statistical module counts longest duration, most long in short-term and average duration
Memory module is stored, memory module stores these temporary files or temporary log file to after specified folder, will be original
All temporary files and temporary log file delete.
In the memory module store average value, maximin temporary log file be log_ " $ 1 " journal file,
The temporary file for storing institute's having time is log_alltime_ " 1 " temporary file.
It can be seen that compared with prior art, the present invention implementing with substantive distinguishing features outstanding and significant progress
Beneficial effect be also obvious.
Specific embodiment:
In order to clarify the technical characteristics of the invention, explaining below by a specific embodiment this programme
It states.
This programme carries out the method that NAS order executes time statistics using script, it is characterised in that includes the following steps:
1) perform script, and create for saving the temporary file for executing the time;For storing the interim text of average value, maximin
Part is log_ " $ 1 ";Temporary file for storing all implementing results is log;For storing, the temporary file of having time is
log_alltime_"$1".2) it counts each NAS order and executes the time, and be saved in temporary file;Temporary file includes using
In storage average value, the temporary log file of maximin, for storing the temporary file of all implementing results, storage is all
The temporary file of time.3) maximum execution time, minimum execution time, the average meter in each NAS order execution time are calculated
Evaluation time, and be saved in temporary file.In step 3), after being saved in temporary file, by the log_ " $ in temporary file
Specified folder is arrived in 1 " and log_alltime_ " $ 1 " storage.
When needing Run Script ./Test.sh parameter 1 is executed.The day Ziwen of # creation storage average value, maximin
Part
touch log_"$1"
The temporary file of all implementing results is stored in # creation
touch log
The file of # creation storage institute's having time
touch log_alltime_"$1"
# or less circulation is used to stat commands and executes the time, and saves it in log_alltime_ " $ 1 "
for i in{1..20}
do
time($1)>>log 2>&1
sleep 1
cat log|tail-n 3|head-n 1|cut-b 8-15>>log_alltime_"$1"
sleep 1
done
# calculates average performance times and is stored in log_ " $ 1 "
Cat log_alltime_ " $ 1 " | awk'{ sum+=$ 1 } END { print " Avg=", sum/NR } ' > > log_ " $
1"
# calculates the maximum execution time time and is stored in log_ " $ 1 "
Awk'BEGIN { max=0 } { if ($ 1+0 > max+0) max=$ 1 } END { print " Max=", max } ' log_
alltime_"$1">>log_"$1"
# calculates minimum execution time time and is stored in log_ " $ 1 "
Awk'BEGIN { min=65536 } { if ($ 1+0 < min+0) min=$ 1 } END { print " Min=", min } '
log_alltime_"$1">>log_"$1"
Two log preservations of log_ " $ 1 " log_alltime_ " $ 1 " are put into desired file and saved by #
cp log_"$1"/home/root/time_count
cp log_alltime_"$1"/home/root/time_count
# deletes temporary folder log
rm–rf log
echo"success"
For the system of the above method, including acquisition monitoring module, statistical module, memory module, output module;Acquisition prison
Control module acquires the execution duration of each NAS order for starting script operation;Statistical module is for counting all NAS orders
The duration of execution, and maximum time and minimum duration are extracted, calculate average duration;Memory module is average for creating storage
Value, maximin, all implementing results temporary file, storage average value, maximin temporary log file and
After the temporary file of storage institute's having time is output to specified folder, all temporary files are deleted;Output module is for exporting
Store average value, maximin to specified folder.
The present invention is not limited in above-mentioned specific embodiment, and those of ordinary skill in the art are in essential scope of the invention
The variations, modifications, additions or substitutions inside made, also should belong to protection scope of the present invention.
Claims (8)
1. a kind of carry out the method that NAS order executes time statistics using script, it is characterised in that include the following steps:
1) perform script, and create for saving the temporary file for executing the time;
2) it counts each NAS order and executes the time, and be saved in temporary file;
3) maximum execution time in each NAS order execution time is calculated, minimum executes time, average calculation times, and protects
It is stored in temporary file.
2. according to claim 1 carry out the method that NAS order executes time statistics using script, it is characterized in that: step
1) temporary file in includes the temporary log file for storing average value, maximin, all executes knot for storing
The temporary file of fruit stores the temporary file of institute's having time.
3. according to claim 2 carry out the method that NAS order executes time statistics using script, it is characterized in that: being used for
Store average value, the temporary file of maximin is log_ " $ 1 ";Temporary file for storing all implementing results is
log;For storing, the temporary file of having time is log_alltime_ " 1 ".
4. according to claim 3 carry out the method that NAS order executes time statistics using script, it is characterized in that: in step
It is rapid 3) in, after being saved in temporary file, by temporary file log_ " $ 1 " and log_alltime_ " $ 1 " storage to specified
File.
5. according to claim 4 carry out the method that NAS order executes time statistics using script, it is characterized in that: will face
When file storage to after specified file, former temporary file is all deleted.
6. according to claim 1 carry out the method that NAS order executes time statistics using script, it is characterized in that: step
1) when needing Run Script in ./Test.sh parameter 1 is executed.
7. a kind of for carrying out the system that NAS order executes time counting method, feature using script described in claim 1
It is: including acquiring monitoring module, statistical module, memory module, output module;
Acquisition monitoring module acquires the execution duration of each NAS order for starting script operation;
Statistical module is used to count the duration that all NAS orders execute, and extracts maximum time and minimum duration, calculates flat
Equal duration;
Memory module be used for create storage average value, maximin, all implementing results temporary file, storage be averaged
After the temporary file of value, the temporary log file of maximin and storage institute's having time is output to specified folder, delete
All temporary files;
Output module is for exporting storage average value, maximin to specified folder.
8. system according to claim 7, it is characterized in that: storing average value, maximin in the memory module
Temporary log file is log_ " 1 " journal file, and the temporary file of storage institute's having time is log_alltime_ " 1 " interim text
Part.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810614036.7A CN108959021A (en) | 2018-06-14 | 2018-06-14 | It is a kind of to carry out the method and system that NAS order executes time statistics using script |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810614036.7A CN108959021A (en) | 2018-06-14 | 2018-06-14 | It is a kind of to carry out the method and system that NAS order executes time statistics using script |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108959021A true CN108959021A (en) | 2018-12-07 |
Family
ID=64488773
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810614036.7A Pending CN108959021A (en) | 2018-06-14 | 2018-06-14 | It is a kind of to carry out the method and system that NAS order executes time statistics using script |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108959021A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104346248A (en) * | 2014-10-17 | 2015-02-11 | 浪潮电子信息产业股份有限公司 | Audit function implementation method based on history command |
CN105653435A (en) * | 2015-12-28 | 2016-06-08 | 曙光信息产业(北京)有限公司 | Performance test method of NFS and performance test device of NFS |
JP2016194777A (en) * | 2015-03-31 | 2016-11-17 | エヌ・ティ・ティ・コムウェア株式会社 | Software test apparatus, software test method, and software test program |
-
2018
- 2018-06-14 CN CN201810614036.7A patent/CN108959021A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104346248A (en) * | 2014-10-17 | 2015-02-11 | 浪潮电子信息产业股份有限公司 | Audit function implementation method based on history command |
JP2016194777A (en) * | 2015-03-31 | 2016-11-17 | エヌ・ティ・ティ・コムウェア株式会社 | Software test apparatus, software test method, and software test program |
CN105653435A (en) * | 2015-12-28 | 2016-06-08 | 曙光信息产业(北京)有限公司 | Performance test method of NFS and performance test device of NFS |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110147411B (en) | Data synchronization method, device, computer equipment and storage medium | |
CN107832371A (en) | A kind of Excel intelligent Matchings import system and method based on financial statement | |
CN108241528B (en) | Dynamic acquisition method for mass network security data customized by user | |
CN105319482A (en) | Power distribution network fault diagnosis system and method based on multi-source information fusion | |
CN105610899B (en) | A kind of parallel method for uploading of text file and device | |
CN113505048A (en) | Unified monitoring platform based on application system portrait and implementation method | |
CN104865860A (en) | Sampling, storing and inquiring method and device of WTGS (Wind Turbine Generator System) state monitoring system | |
CN111092855A (en) | Server operation and maintenance system, method and device and computer readable storage medium | |
CN110224879A (en) | A kind of whole machine cabinet server and its node configuration method, device and CMC | |
CN108959021A (en) | It is a kind of to carry out the method and system that NAS order executes time statistics using script | |
CN102185381B (en) | Method for processing SCD (substation configuration description) iteration of SCD model during automatic switching | |
CN104199732B (en) | A kind of PGA internal memories overflow intelligent processing method | |
CN103957119B (en) | Method for managing network equipment by using MIB file and browser | |
CN107506292A (en) | The automated testing method of random write time delay under a kind of non-homogeneous catalogue of multistage | |
CN110502257B (en) | Transformer substation monitoring information management, control and checking method | |
CN108491483B (en) | Method and device for remotely monitoring running state of program | |
CN114201509A (en) | Electric power data information monitoring system based on real-time database | |
CN110633270B (en) | Multi-strategy electric meter daily freezing value automatic substitution method and device based on priority | |
CN114116252A (en) | System and method for storing operation measurement data of regulation and control system | |
CN109787225B (en) | Distribution network model derivation method, device, equipment and storage medium | |
CN102638365A (en) | Implementation method for automatic discovery of mass equipment in network management | |
CN103135465B (en) | Method for removing on-track latch faults of spread spectrum responder of spacecraft | |
CN105204972B (en) | A kind of unified method and system issued and manage of executable program | |
CN109547260A (en) | A kind of FlexRay network collocating method and system | |
CN117493097A (en) | Method for acquiring latest data position of event log of IPMI system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181207 |
|
RJ01 | Rejection of invention patent application after publication |