Skip to content

RusEu/drf-profiling-mixins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Django Rest Framework Profiling Mixins

Usage

from rest_framework import viewsets

class MyViewSetViewSet(ProfilingMixin, viewsets.ModelViewSet):
    queryset = MyModel.objects.all()
    serializer = MySerializer

In the response you will get an extra __meta__ field containing usefull information for profiling.

    "__meta__": {
        "templating": {
            "rendering_time": 0.04318714141845703
        },
        "database": {
            "execution_time": 0.010000000000000002,
            "queries_count": 10
        }
    }

About

Django Rest Framework Profiling

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages