Tracking Metrics to Surface and Solve Problems: Metric Tracking Practices I’ve Learned So Far

It is a nice pleasant evening, you are sipping coffee and reviewing your code one final time, just so that you can gather enough confidence to hit the deploy button.

But a fact of life as a software engineer is that things can go wrong. Small changes may result in unexpected outcomes, including outages, errors or negatively impacting customers.

And when problems occur, either we can do random checks and validations that may or may not solve the problem or we can have a disciplined problem-solving approach that relies on data rather than intuitions.

Metrics and Telemetry

To enable a disciplined problem-solving method, we need our software to track the right metrics and the right places. We need to design our systems so that they are continually creating telemetry.

What is Telemetry?

The DevOps handbook defines telemetry as,

An automated communication process by which metrics are collected at remote points and are sent over to receiving equipments.

When designing systems, it is a high leverage activity to include creating telemetry as a first-class citizen to enable and ease tracking metrics at all the levels needed, right from business level metrics to deployment pipeline level.

Levels Of Metrics Tracking

As engineers, the software we write impacts the organization at multiple levels, from infrastructure to the product, to business. Thus, to resolve problems quickly, we need to track metrics all these levels.

Following levels of metrics have been really useful for me to keep a checklist for adding the right metrics in the software that I write.

1. Business Level Metrics:

These metrics directly affect the business. Thus are really imported to keep an eye on.

Examples include sales transactions, numbers of items clients sent, total successful items processed, hourly processing rates, etc.

2. Application Level Metrics:

These metrics track the functioning of the application.

Examples include latency of the APIs, response time of queries, number of errors etc.

3. Infrastructure Level Metrics:

These metrics track the infrastructure that runs our application.

Examples include CPU usage, available memory, IOPS spikes etc.

4. Product Level Metrics:

These metrics track the product progress and results. As product engineers, it’s a high leverage task to track product-related metrics too.

Examples include A/B test results, feature toggling results, product progress, product extensibility, and configurability etc

By having telemetry coverage in all these areas, we will be to see the health of everything that our software relies on or things that rely on our software.

Conclusion

With the limited time that I’ve spent in the software industry, I’ve come to realize the importance of metrics. Even the parts that don’t involve any software must be tracked and measured. The key idea here is that you can not improve what you don’t measure.

With right telemetry built into the software that we write, we’ll be able to not only solve the problems they arise but also surface the latent ones before they catch fire.

That’s all, folks!

 

Advertisements

Organization Archetypes And The Concept Of Market-Oriented “Solver Teams”

depositphotos_44074529-stock-illustration-flat-design-illustration-concept-of

Organizations which designs systems are constrained to produce designs which are copies of the communication structure of the organization.

In other words, how we organize our teams has a powerful effect on the software we produce, as well as our resulting architectural and production outcomes.

Thus, in order to get a fast flow of work from Development to Operations, with high quality, great customer outcomes and fast speed of delivery,  we must organize our teams to bring the team structure to our advantage.

Done poorly, this can prevent teams from working safely and independently, instead, they’ll be tightly coupled, all waiting on each other for work to be done.

At SQUAD, teams are structured as market-oriented teams, to quickly respond and solve customer needs. At SQUAD, we call them “Solver Teams”.

 

Organizational Archetypes

meaning-of-life

There are primarily three types of organization structures that inform how we design our DevOps value stream: functional, matrix and market.

Functional-oriented:

Organizations optimize for expertise, division and reducing cost. These organizations centralize expertise and have tall hierarchical structures.

Ex. Server admins, SREs, Data admins

Matrix-oriented:

Organizations attempt to combine functional and market orientation. This results in complicated organization structures like a single person reporting to multiple managers etc.

Market-oriented:

Organizations optimize for responding quickly to customer needs. These organizations tend to be flat, composed of multiple cross-functional disciplines (ex. marketing, engineering, machine learning).

Each market-oriented team is responsible for feature delivery, operational tracking and service support.

Market-Oriented “Solver Teams” at SQUAD

At SQUAD, we have a bunch of interesting problems to solve that highly impact and solve customer needs.

Broadly speaking, solver teams at SQUAD are market-oriented teams, composed of cross-disciplinary work like engineering, marketing, machine learning, data analysis etc to “solve” a customer problem.

These teams are responsible not only for feature development but also for user experiments, testing, optimizations, deployment and operational tracking of services, from idea conception to, successful launch, to retirement, all without dependencies on other solver teams.

Advantages of Market-Oriented Teams

  1. Small teams working independently and safely.
  2. Faster execution and delivery of work.
  3. Enables team members to be “E-Shaped” specialists.

 

Enable every team member to be a generalist

Screenshot from 2018-05-05 21-03-30

As we rely on ever increasing number of technologies. We want engineers who can contribute to multiple areas of value stream.

Another major advantage of the market-oriented teams is that, because of their innate nature of being cross-disciplinary and covering entire value stream from development to operations, it provides opportunities for the team members to develop and multi-specialist capabilities, also called as E-Shaped specialists.

When team members start becoming “E-Shaped” experts, business benefits of enabling faster flow are overwhelming.

As the same team member is able to contribute to multiple points in the value stream, the flow of the stream is much smoother and faster than a specialist working on a single point in the stream without having comprehensive knowledge of the entire value stream.

 

Conclusion

We saw how organization architecture dramatically improves our outcomes. Done well, organizational structure plays as an advantage and helps teams move and deliver faster.

At SQUAD, we structure teams as “solver teams”, which are responsible to own the entire value stream of the problem they are solving.

Solver teams are small and can move fast and safely without having dependencies on other solver teams.

That’s all, folks!

 

How to detect emails, phone numbers, web URLs, hashtags in Android TextView? : SmartTextView library

Smart Text View

Star On GitHub Follow On GitHub

Many applications in android use TextView that detects and highlight various string patterns like emails, phone numbers, web URLs and even hashtags.

This functionality is very common and and is used extensively and frequently in many app. Thus to ease the process of adding this functionality I have authored an Android library SmartTextView.

Find and Star it on GitHubhttps://github.com/priyankvex/SmartTextView

smart_text_view_small

Features

  • Detect emails, mobile numbers, URLs
  • Detect #hash_tags and @mentions
  • Use default intents or set custom callbacks.
  • Set different colors for each pattern.

 

Usage

compile 'com.priyankvex:smarttextview:1.0.1'

In layout xml file

  <com.wordpress.priyankvex.smarttextview.SmartTextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="9pt"
        android:id="@+id/textView"
        />

In java Activity or Fragment

mSmartTextView = (SmartTextView) findViewById(R.id.textView);
        mSmartTextView.setEmailColorCode("#3cb371");
        mSmartTextView.setPhoneNumberColorCode("#ff33aa");
        mSmartTextView.setHashTagColorCode("#f37735");
        mSmartTextView.setUrlColorCode("#ffc425");
        mSmartTextView.setMentionColorCode("#57b884");
        mSmartTextView.setDetectMentions(true);
        mSmartTextView.setDetectHashTags(true);
        mSmartTextView.setText(sampleText);
        mSmartTextView.setSmartTextCallback(this);

To use custom callbacks

implements SmartTextCallback

Rails Number Helper Port to Android

A polyglot developer will understand, there is always something you like about one language and you wish was available for another language too.

So, recently I started learning rails and found number_helper API very cool and fun to use. It gives you easy API to convert numbers into many formats like number_to_human which will convert 20000 to 20 Thousands or number_to_human_size that will convert 1024 to 1 KB.

That was it I wanted this stuff for Android too. It just makes processing numbers to fit the UI needs so damn easy.

Here is my attempt to port this rails module to Android.

Here is the source code :

https://github.com/priyankvex/Rails-Number-Helper-For-Android

Usage : 

Just copy the module number_helper in your application folder and include module dependency.

Examples : 

 


        // Number to human converter
        NumberToHumanConverterBuilder builder2 = new NumberToHumanConverterBuilder(123456);
        NumberToHumanConverter converter2 = builder2.build();
        try {
            String humanNumber = converter2.convert();
            // OUTPUT : 123.456 Thousands
            Log.d(Config.TAG, humanNumber);
        } catch (InvalidSeparatorException | InvalidDelimiterException
                | InvalidPrecisionException e) {
            e.printStackTrace();
        }

Examples can be found here.
https://github.com/priyankvex/Rails-Number-Helper-For-Android/blob/master/app/src/main/java/com/wordpress/priyankvex/numberhelperdemo/MainActivity.java

Features : 

  • Easy to use API.
  • High utility for UI needs.
  • Small in size.
  • Custom exceptions to fit the needs of Android.