Dimuth Karunaratne's fourth-innings effort of 122 in Galle was a memorable, matchwinning effort. His knock was instrumental in Sri Lanka chasing down 268 with plenty to spare. In the process, Karunaratne became only the third Sri Lanka opener to score a fourth-innings century, and the fourth Sri Lanka batsman to score one in a win. That he achieved the feat as captain made it even more special.

Clearly, no one can dispute the import of that innings. However, those who saw it unfold would also have noticed the number of times the rub of the green went his way. He survived three chances - a drop by BJ Watling on 49, another drop by Tom Latham on 58, and a missed stumping at the same score. Apart from those clear chances, there were several instances when he played and missed, or when he played shots he wasn't in control of. According to ESPNcricinfo's ball-by-ball data, Karunaratne was in control of only 78.6% of the deliveries he faced in that innings. The corresponding control percentage for the other Sri Lanka batsmen who batted in the fourth innings was 81. Yet, Karunaratne scored 122, while the others collectively scored 139.

The scorecard only recognises runs scored and wickets taken, but it ignores the route taken to make those contributions. Subjectively, we tend to use terms like "flawless" or "chancy" to describe innings that were error-free or error-strewn, but ESPNcricinfo's control parameter assigns a number to it, by recording, for each ball, whether the batsman was in control or not. It is an interesting stat for an innings, and when calculated over a period of time, it reveals some fascinating trends about batsmen who've tended to be luckier - or tended to survive their not-in-control moments. Over the last couple of years, Karunaratne clearly belongs in that category.

To begin with, a caveat. The control statistic is recorded as a binary, so a batsman is either in control of a delivery or not. Obviously, some not-in-control deliveries pose more of a wicket threat than others, but in terms of the control statistic, they are recorded the same way. Over a longer period of time, the control factor is usually a good measure of how fluent or chancy an innings was.

In the period starting January 2017, Karunaratne averages 40.67, which puts him at 13th out of 32 batsmen who have scored at least 1000 Test runs during this period. That means there are 19 batsmen who have lower averages than him. However, in terms of control percentage he ranks 25th, and only seven batsmen have a lower percentage than him. Those seven include batsmen like Niroshan Dickwella, Quinton de Kock and Jonny Bairstow, who bat in the lower middle order and hence often bat with the tail, leading to situations where they need to take risks and bat aggressively.

Among the batsmen who regularly bat in the top five, only KL Rahul and Alastair Cook have lower control percentages. Of course, they like Karunaratne are openers, and have to face the new ball and fresh fast bowlers, which can partly explain a lower control percentage. However, even among openers, Tom Latham, Aiden Markram and Kraigg Brathwaite have higher control numbers, as does David Warner. As the graph below shows, Karunaratne's control percentage is the lowest among batsmen with similar averages: Dinesh Chandimal, Faf du Plessis, Dean Elgar, Joe Root and David Warner all average between 39 and 42, but have better control percentages. In fact, Kraigg Brathwaite, Ajinkya Rahane and Roston Chase have control percentages of more than 85, but averages below 35.

The grid excludes Niroshan Dickwella, whose control percentage was 75.2
The two blue dots are for Williamson (top right corner, ave 65, control 91.1%) and Karunaratne (ave 40.67, control 82.9%)

Latham and Markram are in fact at the other end of the control spectrum. Leading the way is control king Kane Williamson, Karunaratne's opposite number in the ongoing Sri Lanka-New Zealand series. Williamson, who incidentally was the last captain before Karunaratne to score a fourth-innings century in a win, is the only batsman whose control percentage over the last two-and-a-half years is more than 90. He had a rare poor Test in Galle, but an average of 65 and a control percentage of 91 suggest a batsman who is a master of his craft. Steven Smith isn't far behind in the control stakes, and has an even better average during this period.

Another interesting metric is not-in-control balls per dismissal - that is, the number of false shots a batsman plays per dismissal. In all Tests since the start of 2017, for batsmen batting in the top seven positions, that number is 11.2, which means a batsman, on average, plays about 11 not-in-control shots per dismissal (or makes 11 errors per dismissal). This includes plays-and-misses, edges, getting rapped on the pads, and other false strokes.

The grid excludes Niroshan Dickwella, whose control percentage was 75.2
The two blue dots are for Williamson (bottom right corner, control 91.1%, errors per dismissal 9.5) and Karunaratne (control 82.9%, errors per dismissal 14.8)

This metric, along with the control percentage, offers a good indicator of how batsman fare on the control parameter. A high control percentage and low NIC balls per dismissal suggests a batsman who is usually secure and makes few errors, but those few errors tend to cost him his wicket. Williamson is quite clearly in this category: he averages 9.5 NIC balls per dismissal since January 2017, compared to the overall mean of 11.2 for all batsmen in the top seven. Only three batsmen - Mominul Haque (8.6), Aiden Markram (8.7), and Quinton de Kock (9.2) tend to get out more frequently when playing false shots. Karunaratne, on the other hand, survives 14.8 false shots per dismissal, which is a whopping 32% above the overall average of 11.2. For the 32 batsmen who have scored 1000-plus runs during this period, the average NIC balls per dismissal is 12.1, which means Karunaratne is well above this average as well.

Only two batsmen survive more false strokes per dismissal than Karunaratne: Smith (15.7), and Cheteshwar Pujara (18.4). These higher numbers can perhaps partly be explained by technique: those who tend to play the line and not push out at deliveries are less likely to edge, even though they might get beaten often; similarly, playing with soft hands often ensures that edges fall short of the slips cordon. That might explain why Pujara, primarily a defensive batsman who plays within his limitations, has a much higher NIC-per-dismissal figure than de Kock, an aggressive batsman who loves to go after the bowling. However, this still doesn't explain Williamson's high rate of dismissal when he makes errors.

In Pujara's case, a relatively high control percentage gets combined with a high NIC balls per dismissal, which is ideal from a batsman's point of view - you're good and you're lucky (relatively speaking, from an error-to-dismissal ratio point of view).

Usually, a batsman's control percentage tends to increase as his innings goes along. That is perfectly logical, given that you'd expect the batsman to get more used to the bowling attack and the conditions the longer he stays in the middle, and reduce his errors as the innings goes along. In Karunaratne's case in Galle, though, his control percentage stayed at a relatively low 78.6 despite him facing 243 balls during his innings. In fact, across the 17 innings in which Karunaratne has scored at least a half-century, his control percentage is only 83.9, which is the second-lowest among the 18 batsmen who have made at least 10 fifty-plus scores when batting in the top five, since the start of 2017. Only Usman Khawaja (83.7) has a lower control percentage.

In these innings, Karunaratne's NIC balls per dismissal shoots up to 34.1, which again ties in with a relatively low control percentage over a longer period of time. (If a batsman is dismissed after a 100-ball innings with a control percentage of 85, his NIC balls per dismissal will be 15; if he maintains the same control percentage over 200 balls, the NIC balls per dismissal will go up to 30.) Among the 18 top-five batsmen with at least 10 fifty-plus scores, only three - Azhar Ali, Khawaja and Dean Elgar - make more errors per dismissal. Given that the average control percentage for all 50-plus innings since 2017 is 84.5, and the errors per dismissal in these innings is 27, it is clear that Karunaratne bats with slightly less control than the average batsman making a 50-plus score, but he tends to get away with more errors.

At the other end of the spectrum is, again, Williamson. His control percentage goes up marginally to 91.7, while his NIC balls per dismissal stays at a relatively low 16.5.

Fewest errors per dismissal in 50+ scores (Min 10 innings)*
Batsman Inns Control % Errors per dismissal
 Kane Williamson  12  91.7  16.5
 David Warner  11  87.7  16.7
 Aiden Markram  10  89.7  18.3
 Joe Root  20  85.8  21.9
 Angelo Mathews  10  87.1  22.3
*Batsmen in the top 5, since Jan 2017

Benchmarking Karunaratne's control in his 50-plus scores against the universal average is quite revealing too: since the start of 2017, the average control factor for all innings of 50 or more runs in Tests is 84.5. In the 17 innings in which Karunaratne has crossed 50 in this period, his control percentage has exceeded 84.5 only four times. Among the 24 batsmen with 10 or more 50-plus scores in this period, only Dickwella and Bairstow have had below-average control stats more often.

Williamson, on the other hand, has had control levels of less than 84.5 in only once in his 12 innings of 50 or more. That was against Bangladesh earlier this year, when he scored 74 with a control percentage of 82.9. Nine times out of 12 his control percentage has exceeded 90.

Highest percentage of 50+ scores at control factor of more than 84.5%
Batsman 50+ scores Inns > 84.5% control Percent
 Kane Williamson  12  11  91.67
 Dinesh Chandimal  11  10  90.91
 Aiden Markram  10  9  90.00
 Kusal Mendis  12  10  83.33
 Henry Nicholls  12  9  75.00

The control numbers are outstanding for Williamson, no matter how you dissect them. Karunaratne's don't look so hot, but then he has proved he possesses a quality that is vital to succeed at the top level: forget about what happened the previous ball, and focus on the next one. The scoreboard, after all, doesn't differentiate between a century scored with 95% control, and one scored with 80%.

With inputs from Shiva Jayaraman

S Rajesh is stats editor of ESPNcricinfo. @rajeshstats