Correct way to measure Defence budget of a country like India I read that defence budget of the country is 2-3% of GDP, but isnt GDP  irrelevant when we are talking about expenditure? Shouldn't it be in a ratio of military import/total import?
So the budget is simply measured by adding up all the expenses. 

The comparison to GDP that you reference is that we can measure how 'intensive' that sector is in the economy by what size of the economic pie is spent on that sector. So a country could spend a seemingly large amount of money, but if their overall economy is large enough, the military spending to GDP ratio would be small, indicating that the country isn't too devoted to that sector. 

https://en.wikipedia.org/wiki/List_of_countries_by_military_expenditures

As we can see in the link, India spends 2.3% and the US spend 3.3%, while the actual number is different by an order of magnitude. So the ratio gives us a way to compare across countries as the absolute numbers ignore a country's size.