Performance test – stress test the stored process through Jmeter!

Table of Contents 1. Stored procedure preparation: 2. Preparation of test tools: 3. Tool configuration and execution: 2. Configure the throughput controller (can be skipped): 3. Configure JDBC Request: For stored procedures: For SQL statements: 4. Other configurations such as query result tree, aggregation report, TPS, PerfMon monitoring, etc. are the same as the basic […]

nebula-br local-store mode, quick practice of building active and standby clusters

Because the online graph database is currently a single cluster, the amount of data is relatively large, and it has the following disadvantages: Single point of risk. Once the cluster crashes or some queries bring down the entire cluster, all graph operations will be affected. Many optimization classes are difficult to perform but will affect […]

[MySQL] Stored procedures and stored functions

[MySQL] Stored procedures and stored functions 1. Overview of stored procedures and functions Meaning: The English name for stored procedure is Stored Procedure. Its idea is very simple, it is a set of pre-compiled SQL statements of packaging. Execution process: The stored procedure is stored on the MySQL server in advance. When it needs to […]

Use Python to analyze the distribution relationship between Luckin and Starbucks nationwide stores

WillLuckinshakeStarbucks’industrystatus? Lastmonth,LuckinCoffee’ssaucelattebecamepopular,puttingLuckininthespotlightagain.Thelasttimewaswhenitcommittedfinancialfraud. Thedomesticcoffeemarkethasbeenboominginrecentyears,drivingtherapiddevelopmentofmanycoffeebrandsincludingLuckin.From2013to2023,China’spercapitacoffeeconsumptionisexpectedtoincreaseby238%.Thetotalnumberofcoffeestoresinthecountrynowexceeds100,000.Andthenumberisgrowingbytensofthousandseveryyear. TheriseofLuckinCoffeeremindsusofStarbucks,thebenchmarkinthecoffeeindustry.Starbuckshasbeenalmostsynonymouswithcoffeeinthepasttenyearsandisalsothelifestyleofurbanwhite-collarworkers. WhatishappeningnowisthatwhereverthereisaStarbucksstore,thereisalmostaLuckinstorewithinafewhundredmeters,andsomeareevensurroundedbytwoorthree. ThefollowingusesvisualdashboardsandPythondataanalysistocomparethedifferencesandcorrelationsbetweenStarbucksandLuckinstoresintermsofquantity,regionaldistribution. Therearetwomainfindings: 1.StarbucksismoreconcentratedineconomicallydevelopedcoastalareassuchastheYangtzeRiverDelta,PearlRiverDelta,andBeijing-Tianjin-Hebei,especiallyfirst-andsecond-tiercities.LuckinismoredispersedthanStarbucksandhasstoresinmanythird-andfourth-tiercitiesandbelow. 2.LuckinstorelocationsareconcentratedaroundStarbucks.Datashowsthatwithinaradiusof500meters,thereareanaverageof0.6LuckinstoresaroundeachStarbucksstorenationwide. Preparationphase ThetoolsusedinthisanalysistaskincludeNextDataRobot,Python,andshapely. XiamiaoDataRobotisaclouddataplatformthatintegratesdatasets,datacleaning,dataanalysis,datavisualizationandbillboardconstruction.TheStarbucksandLuckinstoredatasetsusedinthisanalysisareallstoredinXiamiaoDataRobot. Wewilldevelopdatadashboardsbasedondatasets,andalsouseAPIinterfacestodirectlycallPythonfordataanalysisandvisualization.Pythonisusedtoconnecttothedatainterfaceoftherobotandprocessandanalyzethedata. Shapelyisathird-partylibraryforPython,usedtoprocesslatitudeandlongitudedata,andcandeterminethedistanceandinclusionrelationshipbetweendifferentgeographicalcoordinates. Dataset BecauseweneedtocompareandanalyzethenumberandlocationofStarbucksandLuckinstores,themainfieldsofthedatasetincludestorename,longitude,latitude,andcity. ? Note:Thedatasetisin2022,andthereisaquantitativeerrorofabout20%. ? NationalStarbuckscoffeestoredataset:NationalLuckinCoffeeStoredataset: Bothdatasetsarestoredonthenextdatarobotplatform.Youcandirectlyviewandusethedatasetsthroughthedataview,whichwewillusetobuildadatadashboardlater. BecausePythonisneededtoprocessthedatalater,thedataneedstobeobtainedthroughtheAPIdatainterface.Itisveryconvenienttooperateandcanbesavedforlateruse. importrequests headers={“x-token”:”yourauthenticationtoken”} response=requests.get(“http://app.chafer.nexadata.cn/openapi/v1/sheet/sht22nId5uouP2/records?size=1&page=1”,headers=headers) print(response.json()) Buildananalysisdashboard ItisrelativelysimpletobuildadashboardontheNextDataRobot.First,createaprocesstaskandselecttwodataviews:StarbucksandLuckin. ThencreateaKanbanboardandeditthedesignchart,whichissimilartowhatweusuallydoonBIsoftware. Therearemorethanadozenchartformshere,whichcanbasicallymeetmostvisualizationscenarios. ComparisonofthenumberofStarbucksandLuckinstoresnationwide Asofthedatasettime(2022),thenumberofStarbucksstoresnationwideisexpectedtobe4,442,andthenumberofLuckinCoffeestoresnationwideisexpectedtobe3,904.Starbuckshas14%morestoresthanLuckin. Judgingfromthemagnitude,thetwoareveryclose,andLuckinisexpandingitsstoresataterrifyinggrowthrate.Takingthebusinessdistrictnearmyhomeasanexample,therewasonlyoneLuckinlastyear,andtherearethreethisyear. StarbucksismoredemandingthanRuixingintermsoflocation,storeopeningcost,storearea,andnumberofstoreemployees.Ruixingspecializesintakeout+takeout.ThisisalsothereasonwhyRuixingcanexpandrapidlyinadditiontomarketdemandfactors. Starbucksisdistributedinthetop20citiesacrossthecountry ThetopfivecitieswiththenumberofStarbucksstoresare:Shanghai,Beijing,Hangzhou,Shenzhen,andGuangzhou.Amongthetop20cities,thereare6intheYangtzeRiverDelta,5inthePearlRiverDelta,and2intheBeijing-Tianjin-Hebeiregion. ThenumberofStarbucksstoresinShanghaiis668,whichistwiceasmanyasthesecond-placeBeijing.Atthesametime,ShanghaiisalsothecitywiththelargestnumberofStarbucksstoresintheworld.ItseemsthatthepeopleofShanghaihaveawell-deservedloveforcoffee. ThenumberofStarbucksinHangzhouissecondonlytoShanghaiandBeijing,andhigherthanShenzhenandGuangzhou.Internetande-commercepractitionersinHangzhoualsopreferStarbucks. LuckinisdistributedinTop20citiesacrossthecountry ThetopfivecitieswiththenumberofLuckinstoresare:Shanghai,Beijing,Guangzhou,Shenzhen,andHangzhou.TheyarethesameasthetopfivecitiesforStarbucks,buttheorderingisslightlydifferent. Amongthetop20cities,thereare6intheYangtzeRiverDelta,2inthePearlRiverDelta,and2intheBeijing-Tianjin-Hebeiregion. Starbucksismainlyconcentratedinfirst-andsecond-tiercoastalcities,whileLuckinisrapidlyoccupyingthemarketininlandcities.Luckin’stop20citiesalreadyincludeHefei,Kunming,andZhengzhou,butthesethreeprovincialcapitalcitiesarenotinStarbucks’top20. Therefore,thedistributionofLuckinstoresismoredispersedandnotoverlyconcentratedinfirst-tiercities. Starbucksnationwidedistributionheatmap ItcanalsobeseenfromtheheatmapofStarbucksstoresthattheredhigh-densityareasaremainlyconcentratedincoastalareas,whiletheinlandareasaredistributedinapoint-likemannerandarerelativelysparse. Ruixing’snationwidedistributionheatmap ThedistributionofLuckinstoresismoreeven.Inadditiontocoastalareas,therearealsomanystoresincentralChinasuchasHunan,Anhui,Hubei,andHunan. StarbucksShanghaidistributionheatmap Shanghaiisthecitywiththelargestcoffeeconsumptiondemandinthecountry.Let’stakealookatthedistributionofStarbucksstoresinShanghai. Generallyspeaking,StarbucksstoresareconcentratedintheinnerringofShanghai,andarescatteredoutwardsindottedlines.Thefivemajornewcitiesinthesuburbs,PudongAirport,andHongqiaohubarealsorelativelyconcentratedareas. LuckinShanghaidistributionheatmap TheconcentrationofLuckinintheinnerringofShanghaiisnotasobviousasthatofStarbucks,andtheoverallnumberisalsomuchsmaller. Pythondataanalysis Previously,weanalyzedthedistributionofStarbucksandLuckinstoresacrossthecountrybybuildingavisualsignageontheNextMiaoRobot.Theregionaldifferencesarestillquiteobvious. Let’sfurtheranalyzetherelationshipbetweenStarbucksandLuckinstores.WeknowthatLuckinCoffeeisarisingstar.ItissaidthatthelocationofmanystoresmainlydependsonwhetherthereisaStarbucksnearby. […]

Javascript webstorage data storage problem, undefined cannot be stored directly

This article shares a small problem I encountered when using sessionStorage, and I will avoid this pitfall in the future. The requirement is cell editing in easyui tables. When you click save, the editing of the current row will end, and then the editingId (the ID of the current editing row record) will be modified. […]

Use C++ to design n integer matrices M1..Mn for continuous multiplication. The dimension of each matrix is between 1-200, the number of matrices n is between 5-180, and the matrix elements are non-negative integers of at most 2 digits. Each matrix The sum result matrix is stored in the form of a text file with the file name M1…

Use C++ to design n integer matrices M1..Mn for continuous multiplication. The dimension of each matrix is between 1-200, the number of matrices n is between 5-180, and the matrix elements are non-negative integers of at most 2 digits. Each matrix and the result matrix are stored in the form of text files. The file […]

Practical analysis of dump and strace commands causing watchdog problems caused by keystore deadlock

1. Problem description Recently, a system stuck problem occurred. It is speculated that a watchdog appears in system_server. Looking at the watchdog file, it is PackageManager stuck in the KeyStore.clearUid() interface: —– pid 1091 at 2023-10-26 09:40:10 —– Cmd line: system_server ABI: ‘arm64’ “PackageManager” sysTid=1352 #00 pc 000000000006e1c4 /system/lib64/libc.so (__ioctl + 4) #01 pc 00000000000290d0 […]

Views, triggers and stored procedures

Python operates MySQL The origin of SQL: MySQL itself is a C/S architecture, with a server and a client. It comes with a client: mysql.exe The python language has become the client of MySQL (for a server, there can be many clients) Steps: 1. Connect to MySQL first host, port, username, password, charset, library, etc. […]

[Integer data and floating point data] How are they stored in memory? Understanding of original code, inverse code and complement code

Article directory Preface 1. Introduction to data types 2. Storage of integers in memory 2.1 Original code, complement code, complement code 2.2 Little-endian storage and big-endian storage 2.3 Signed data and unsigned data 2.4 Exercise: Determine whether the storage mode of the current machine is big endian or little endian? 3. Reading of integer data […]